Quickstart
Samediff Quickstart
SameDiff sd = SameDiff.create();/*
Variables can be added to a graph in a number of ways.
You can think of variables as "holders" of an n-dimensional array - specifically, an ND4J INDArray
First, let's create a variable based on a specified array, with the name "myVariable"
*/
INDArray values = Nd4j.ones(3,4);
SDVariable variable = sd.var("myVariable", values);
//We can then perform operations on the variable:
SDVariable plusOne = variable.add(1.0); //Name: automatically generated as "add"
SDVariable mulTen = variable.mul("mulTen", 10.0); //Name: Defined to be "mulTen"Last updated
Was this helpful?