org.nd4j.autodiff.samediff.ops

## Class SDMath

• ```public class SDMath
extends SDOps```

• ### Fields inherited from class org.nd4j.autodiff.samediff.ops.SDOps

`sd`
• ### Constructor Summary

Constructors
Constructor and Description
`SDMath(SameDiff sameDiff)`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`SDVariable` `abs(SDVariable x)`
Elementwise absolute value operation: out = abs(x)
`SDVariable` ```abs(String name, SDVariable x)```
Elementwise absolute value operation: out = abs(x)
`SDVariable` `acos(SDVariable x)`
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)
`SDVariable` ```acos(String name, SDVariable x)```
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)
`SDVariable` `acosh(SDVariable x)`
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)
`SDVariable` ```acosh(String name, SDVariable x)```
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)
`SDVariable` ```add(SDVariable x, double value)```
Scalar add operation, out = in + scalar
`SDVariable` ```add(SDVariable x, SDVariable y)```
Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```add(String name, SDVariable x, double value)```
Scalar add operation, out = in + scalar
`SDVariable` ```add(String name, SDVariable x, SDVariable y)```
Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```amax(SDVariable in, int... dimensions)```
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))
`SDVariable` ```amax(String name, SDVariable in, int... dimensions)```
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))
`SDVariable` ```amean(SDVariable in, int... dimensions)```
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))
`SDVariable` ```amean(String name, SDVariable in, int... dimensions)```
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))
`SDVariable` ```amin(SDVariable in, int... dimensions)```
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))
`SDVariable` ```amin(String name, SDVariable in, int... dimensions)```
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))
`SDVariable` ```and(SDVariable x, SDVariable y)```
Boolean AND operation: elementwise (x !
`SDVariable` ```and(String name, SDVariable x, SDVariable y)```
Boolean AND operation: elementwise (x !
`SDVariable` `asin(SDVariable x)`
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)
`SDVariable` ```asin(String name, SDVariable x)```
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)
`SDVariable` `asinh(SDVariable x)`
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)
`SDVariable` ```asinh(String name, SDVariable x)```
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)
`SDVariable` ```asum(SDVariable in, int... dimensions)```
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
`SDVariable` ```asum(String name, SDVariable in, int... dimensions)```
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
`SDVariable` `atan(SDVariable x)`
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)
`SDVariable` ```atan(String name, SDVariable x)```
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)
`SDVariable` ```atan2(SDVariable y, SDVariable x)```
Elementwise atan (arctangent, inverse tangent) operation: out = atan2(x,y).
`SDVariable` ```atan2(String name, SDVariable y, SDVariable x)```
Elementwise atan (arctangent, inverse tangent) operation: out = atan2(x,y).
`SDVariable` `atanh(SDVariable x)`
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)
`SDVariable` ```atanh(String name, SDVariable x)```
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)
`SDVariable` ```bitShift(SDVariable x, SDVariable shift)```
Bit shift operation
`SDVariable` ```bitShift(String name, SDVariable x, SDVariable shift)```
Bit shift operation
`SDVariable` ```bitShiftRight(SDVariable x, SDVariable shift)```
Right bit shift operation
`SDVariable` ```bitShiftRight(String name, SDVariable x, SDVariable shift)```
Right bit shift operation
`SDVariable` ```bitShiftRotl(SDVariable x, SDVariable shift)```
Cyclic bit shift operation
`SDVariable` ```bitShiftRotl(String name, SDVariable x, SDVariable shift)```
Cyclic bit shift operation
`SDVariable` ```bitShiftRotr(SDVariable x, SDVariable shift)```
Cyclic right shift operation
`SDVariable` ```bitShiftRotr(String name, SDVariable x, SDVariable shift)```
Cyclic right shift operation
`SDVariable` `ceil(SDVariable x)`
Element-wise ceiling function: out = ceil(x).
`SDVariable` ```ceil(String name, SDVariable x)```
Element-wise ceiling function: out = ceil(x).
`SDVariable` ```clipByAvgNorm(SDVariable x, double clipValue, int... dimensions)```
Clips tensor values to a maximum average L2-norm.
`SDVariable` ```clipByAvgNorm(String name, SDVariable x, double clipValue, int... dimensions)```
Clips tensor values to a maximum average L2-norm.
`SDVariable` ```clipByNorm(SDVariable x, double clipValue, int... dimensions)```
Clipping by L2 norm, optionally along dimension(s)
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed
Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped according
to the corresponding l2Norm along the specified dimensions
`SDVariable` ```clipByNorm(String name, SDVariable x, double clipValue, int... dimensions)```
Clipping by L2 norm, optionally along dimension(s)
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed
Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped according
to the corresponding l2Norm along the specified dimensions
`SDVariable` ```clipByValue(SDVariable x, double clipValueMin, double clipValueMax)```
Element-wise clipping function:
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax
out[i] = clipValueMin if in[i] < clipValueMin
out[i] = clipValueMax if in[i] > clipValueMax
`SDVariable` ```clipByValue(String name, SDVariable x, double clipValueMin, double clipValueMax)```
Element-wise clipping function:
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax
out[i] = clipValueMin if in[i] < clipValueMin
out[i] = clipValueMax if in[i] > clipValueMax
`SDVariable` ```confusionMatrix(SDVariable labels, SDVariable pred, DataType dataType)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(SDVariable labels, SDVariable pred, int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(SDVariable labels, SDVariable pred, SDVariable weights)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(SDVariable labels, SDVariable pred, SDVariable weights, int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(String name, SDVariable labels, SDVariable pred, DataType dataType)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(String name, SDVariable labels, SDVariable pred, int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(String name, SDVariable labels, SDVariable pred, SDVariable weights)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` ```confusionMatrix(String name, SDVariable labels, SDVariable pred, SDVariable weights, int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
`SDVariable` `cos(SDVariable x)`
Elementwise cosine operation: out = cos(x)
`SDVariable` ```cos(String name, SDVariable x)```
Elementwise cosine operation: out = cos(x)
`SDVariable` `cosh(SDVariable x)`
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)
`SDVariable` ```cosh(String name, SDVariable x)```
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)
`SDVariable` ```cosineDistance(SDVariable x, SDVariable y, int... dimensions)```
Cosine distance reduction operation.
`SDVariable` ```cosineDistance(String name, SDVariable x, SDVariable y, int... dimensions)```
Cosine distance reduction operation.
`SDVariable` ```cosineSimilarity(SDVariable x, SDVariable y, int... dimensions)```
Cosine similarity pairwise reduction operation.
`SDVariable` ```cosineSimilarity(String name, SDVariable x, SDVariable y, int... dimensions)```
Cosine similarity pairwise reduction operation.
`SDVariable` ```countNonZero(SDVariable in, int... dimensions)```
Count non zero array reduction operation, optionally along specified dimensions: out = count(x !
`SDVariable` ```countNonZero(String name, SDVariable in, int... dimensions)```
Count non zero array reduction operation, optionally along specified dimensions: out = count(x !
`SDVariable` ```countZero(SDVariable in, int... dimensions)```
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)
`SDVariable` ```countZero(String name, SDVariable in, int... dimensions)```
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)
`SDVariable` ```cross(SDVariable a, SDVariable b)```
Returns the pair-wise cross product of equal size arrays a and b: a x b = ||a||x||b|| sin(theta).
`SDVariable` ```cross(String name, SDVariable a, SDVariable b)```
Returns the pair-wise cross product of equal size arrays a and b: a x b = ||a||x||b|| sin(theta).
`SDVariable` `cube(SDVariable x)`
Element-wise cube function: out = x^3
`SDVariable` ```cube(String name, SDVariable x)```
Element-wise cube function: out = x^3
`SDVariable` `diag(SDVariable x)`
Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0
For example, if input = [1,2,3], then output is given by:
[ 1, 0, 0]
[ 0, 2, 0]
[ 0, 0, 3]

Higher input ranks are also supported: if input has shape [a,...
`SDVariable` ```diag(String name, SDVariable x)```
Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0
For example, if input = [1,2,3], then output is given by:
[ 1, 0, 0]
[ 0, 2, 0]
[ 0, 0, 3]

Higher input ranks are also supported: if input has shape [a,...
`SDVariable` `diagPart(SDVariable x)`
Extract the diagonal part from the input array.
`SDVariable` ```diagPart(String name, SDVariable x)```
Extract the diagonal part from the input array.
`SDVariable` ```div(SDVariable x, double value)```
Scalar division operation, out = in / scalar
`SDVariable` ```div(SDVariable x, SDVariable y)```
Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```div(String name, SDVariable x, double value)```
Scalar division operation, out = in / scalar
`SDVariable` ```div(String name, SDVariable x, SDVariable y)```
Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```embeddingLookup(SDVariable x, SDVariable indices, PartitionMode PartitionMode)```
Looks up ids in a list of embedding tensors.
`SDVariable` ```embeddingLookup(String name, SDVariable x, SDVariable indices, PartitionMode PartitionMode)```
Looks up ids in a list of embedding tensors.
`SDVariable` ```entropy(SDVariable in, int... dimensions)```
Entropy reduction: -sum(x * log(x))
`SDVariable` ```entropy(String name, SDVariable in, int... dimensions)```
Entropy reduction: -sum(x * log(x))
`SDVariable` `erf(SDVariable x)`
Element-wise Gaussian error function - out = erf(in)
`SDVariable` ```erf(String name, SDVariable x)```
Element-wise Gaussian error function - out = erf(in)
`SDVariable` `erfc(SDVariable x)`
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)
`SDVariable` ```erfc(String name, SDVariable x)```
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)
`SDVariable` ```euclideanDistance(SDVariable x, SDVariable y, int... dimensions)```
Euclidean distance (l2 norm, l2 distance) reduction operation.
`SDVariable` ```euclideanDistance(String name, SDVariable x, SDVariable y, int... dimensions)```
Euclidean distance (l2 norm, l2 distance) reduction operation.
`SDVariable` `exp(SDVariable x)`
Elementwise exponent function: out = exp(x) = 2.71828...
`SDVariable` ```exp(String name, SDVariable x)```
Elementwise exponent function: out = exp(x) = 2.71828...
`SDVariable` `expm1(SDVariable x)`
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...
`SDVariable` ```expm1(String name, SDVariable x)```
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...
`SDVariable` `eye(int rows)`
Generate an identity matrix with the specified number of rows and columns.
`SDVariable` ```eye(int rows, int cols)```
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE
`SDVariable` ```eye(int rows, int cols, DataType dataType, int... dimensions)```
Generate an identity matrix with the specified number of rows and columns
Example:

``` INDArray eye = eye(3,2)<br> eye:<br> [ 1, 0]<br> [ 0, 1]<br> [ 0, 0]```

`SDVariable` `eye(SDVariable rows)`
As per eye(String, int) but with the number of rows specified as a scalar INDArray
`SDVariable` ```eye(SDVariable rows, SDVariable cols)```
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays
`SDVariable` ```eye(String name, int rows)```
Generate an identity matrix with the specified number of rows and columns.
`SDVariable` ```eye(String name, int rows, int cols)```
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE
`SDVariable` ```eye(String name, int rows, int cols, DataType dataType, int... dimensions)```
Generate an identity matrix with the specified number of rows and columns
Example:

``` INDArray eye = eye(3,2)<br> eye:<br> [ 1, 0]<br> [ 0, 1]<br> [ 0, 0]```

`SDVariable` ```eye(String name, SDVariable rows)```
As per eye(String, int) but with the number of rows specified as a scalar INDArray
`SDVariable` ```eye(String name, SDVariable rows, SDVariable cols)```
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays
`SDVariable` ```firstIndex(SDVariable in, Condition condition, boolean keepDims, int... dimensions)```
First index reduction operation.
`SDVariable` ```firstIndex(SDVariable in, Condition condition, int... dimensions)```
First index reduction operation.
`SDVariable` ```firstIndex(String name, SDVariable in, Condition condition, boolean keepDims, int... dimensions)```
First index reduction operation.
`SDVariable` ```firstIndex(String name, SDVariable in, Condition condition, int... dimensions)```
First index reduction operation.
`SDVariable` `floor(SDVariable x)`
Element-wise floor function: out = floor(x).
`SDVariable` ```floor(String name, SDVariable x)```
Element-wise floor function: out = floor(x).
`SDVariable` ```floorDiv(SDVariable x, SDVariable y)```
Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```floorDiv(String name, SDVariable x, SDVariable y)```
Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```floorMod(SDVariable x, double value)```
Scalar floor modulus operation
`SDVariable` ```floorMod(SDVariable x, SDVariable y)```
Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```floorMod(String name, SDVariable x, double value)```
Scalar floor modulus operation
`SDVariable` ```floorMod(String name, SDVariable x, SDVariable y)```
Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```hammingDistance(SDVariable x, SDVariable y, int... dimensions)```
Hamming distance reduction operation.
`SDVariable` ```hammingDistance(String name, SDVariable x, SDVariable y, int... dimensions)```
Hamming distance reduction operation.
`SDVariable` ```iamax(SDVariable in, boolean keepDims, int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
`SDVariable` ```iamax(SDVariable in, int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
`SDVariable` ```iamax(String name, SDVariable in, boolean keepDims, int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
`SDVariable` ```iamax(String name, SDVariable in, int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
`SDVariable` ```iamin(SDVariable in, boolean keepDims, int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
`SDVariable` ```iamin(SDVariable in, int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
`SDVariable` ```iamin(String name, SDVariable in, boolean keepDims, int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
`SDVariable` ```iamin(String name, SDVariable in, int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
`SDVariable` `isFinite(SDVariable x)`
Is finite operation: elementwise isFinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` ```isFinite(String name, SDVariable x)```
Is finite operation: elementwise isFinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` `isInfinite(SDVariable x)`
Is infinite operation: elementwise isInfinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` ```isInfinite(String name, SDVariable x)```
Is infinite operation: elementwise isInfinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` `isMax(SDVariable x)`
Is maximum operation: elementwise x == max(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` ```isMax(String name, SDVariable x)```
Is maximum operation: elementwise x == max(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` `isNaN(SDVariable x)`
Is Not a Number operation: elementwise isNaN(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` ```isNaN(String name, SDVariable x)```
Is Not a Number operation: elementwise isNaN(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
`SDVariable` `isNonDecreasing(SDVariable x)`
Is the array non decreasing?
`SDVariable` ```isNonDecreasing(String name, SDVariable x)```
Is the array non decreasing?
`SDVariable` `isStrictlyIncreasing(SDVariable x)`
Is the array strictly increasing?
`SDVariable` ```isStrictlyIncreasing(String name, SDVariable x)```
Is the array strictly increasing?
`SDVariable` ```jaccardDistance(SDVariable x, SDVariable y, int... dimensions)```
Jaccard similarity reduction operation.
`SDVariable` ```jaccardDistance(String name, SDVariable x, SDVariable y, int... dimensions)```
Jaccard similarity reduction operation.
`SDVariable` ```lastIndex(SDVariable in, Condition condition, boolean keepDims, int... dimensions)```
Last index reduction operation.
`SDVariable` ```lastIndex(SDVariable in, Condition condition, int... dimensions)```
Last index reduction operation.
`SDVariable` ```lastIndex(String name, SDVariable in, Condition condition, boolean keepDims, int... dimensions)```
Last index reduction operation.
`SDVariable` ```lastIndex(String name, SDVariable in, Condition condition, int... dimensions)```
Last index reduction operation.
`SDVariable[]` ```listDiff(SDVariable x, SDVariable y)```
Calculates difference between inputs X and Y.
`SDVariable[]` ```listDiff(String[] names, SDVariable x, SDVariable y)```
Calculates difference between inputs X and Y.
`SDVariable` `log(SDVariable x)`
Element-wise logarithm function (base e - natural logarithm): out = log(x)
`SDVariable` ```log(SDVariable x, double base)```
Element-wise logarithm function (with specified base): out = log_{base}(x)
`SDVariable` ```log(String name, SDVariable x)```
Element-wise logarithm function (base e - natural logarithm): out = log(x)
`SDVariable` ```log(String name, SDVariable x, double base)```
Element-wise logarithm function (with specified base): out = log_{base}(x)
`SDVariable` `log1p(SDVariable x)`
Elementwise natural logarithm function: out = log_e (1 + x)
`SDVariable` ```log1p(String name, SDVariable x)```
Elementwise natural logarithm function: out = log_e (1 + x)
`SDVariable` ```logEntropy(SDVariable in, int... dimensions)```
Log entropy reduction: log(-sum(x * log(x)))
`SDVariable` ```logEntropy(String name, SDVariable in, int... dimensions)```
Log entropy reduction: log(-sum(x * log(x)))
`SDVariable` ```logSumExp(SDVariable input, int... dimensions)```
Log-sum-exp reduction (optionally along dimension).
`SDVariable` ```logSumExp(String name, SDVariable input, int... dimensions)```
Log-sum-exp reduction (optionally along dimension).
`SDVariable` ```manhattanDistance(SDVariable x, SDVariable y, int... dimensions)```
Manhattan distance (l1 norm, l1 distance) reduction operation.
`SDVariable` ```manhattanDistance(String name, SDVariable x, SDVariable y, int... dimensions)```
Manhattan distance (l1 norm, l1 distance) reduction operation.
`SDVariable` `matrixDeterminant(SDVariable in)`
Matrix determinant op.
`SDVariable` ```matrixDeterminant(String name, SDVariable in)```
Matrix determinant op.
`SDVariable` `matrixInverse(SDVariable in)`
Matrix inverse op.
`SDVariable` ```matrixInverse(String name, SDVariable in)```
Matrix inverse op.
`SDVariable` ```max(SDVariable x, SDVariable y)```
Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```max(String name, SDVariable x, SDVariable y)```
Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` `mergeAdd(SDVariable... inputs)`
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]
`SDVariable` ```mergeAdd(String name, SDVariable... inputs)```
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]
`SDVariable` `mergeAvg(SDVariable... inputs)`
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]
`SDVariable` ```mergeAvg(String name, SDVariable... inputs)```
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]
`SDVariable` `mergeMax(SDVariable... inputs)`
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]
`SDVariable` ```mergeMax(String name, SDVariable... inputs)```
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]
`SDVariable` `mergeMaxIndex(SDVariable... x)`
Return array of max elements indices with along tensor dimensions
`SDVariable` ```mergeMaxIndex(SDVariable[] x, DataType dataType)```
Return array of max elements indices with along tensor dimensions
`SDVariable` ```mergeMaxIndex(String name, SDVariable... x)```
Return array of max elements indices with along tensor dimensions
`SDVariable` ```mergeMaxIndex(String name, SDVariable[] x, DataType dataType)```
Return array of max elements indices with along tensor dimensions
`SDVariable[]` ```meshgrid(SDVariable[] inputs, boolean cartesian)```
Broadcasts parameters for evaluation on an N-D grid.
`SDVariable[]` ```meshgrid(String[] names, SDVariable[] inputs, boolean cartesian)```
Broadcasts parameters for evaluation on an N-D grid.
`SDVariable` ```min(SDVariable x, SDVariable y)```
Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```min(String name, SDVariable x, SDVariable y)```
Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```mod(SDVariable x, SDVariable y)```
Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```mod(String name, SDVariable x, SDVariable y)```
Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable[]` ```moments(SDVariable input, int... axes)```
Calculate the mean and (population) variance for the input variable, for the specified axis
`SDVariable[]` ```moments(String[] names, SDVariable input, int... axes)```
Calculate the mean and (population) variance for the input variable, for the specified axis
`SDVariable` ```mul(SDVariable x, double value)```
Scalar multiplication operation, out = in * scalar
`SDVariable` ```mul(SDVariable x, SDVariable y)```
Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```mul(String name, SDVariable x, double value)```
Scalar multiplication operation, out = in * scalar
`SDVariable` ```mul(String name, SDVariable x, SDVariable y)```
Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` `neg(SDVariable x)`
Elementwise negative operation: out = -x
`SDVariable` ```neg(String name, SDVariable x)```
Elementwise negative operation: out = -x
`SDVariable[]` ```normalizeMoments(SDVariable counts, SDVariable means, SDVariable variances, double shift)```
Calculate the mean and variance from the sufficient statistics
`SDVariable[]` ```normalizeMoments(String[] names, SDVariable counts, SDVariable means, SDVariable variances, double shift)```
Calculate the mean and variance from the sufficient statistics
`SDVariable` ```or(SDVariable x, SDVariable y)```
Boolean OR operation: elementwise (x !
`SDVariable` ```or(String name, SDVariable x, SDVariable y)```
Boolean OR operation: elementwise (x !
`SDVariable` ```pow(SDVariable x, double value)```
Element-wise power function: out = x^value
`SDVariable` ```pow(SDVariable x, SDVariable y)```
Element-wise (broadcastable) power function: out = x[i]^y[i]
`SDVariable` ```pow(String name, SDVariable x, double value)```
Element-wise power function: out = x^value
`SDVariable` ```pow(String name, SDVariable x, SDVariable y)```
Element-wise (broadcastable) power function: out = x[i]^y[i]
`SDVariable` `rationalTanh(SDVariable x)`
Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximation
`SDVariable` ```rationalTanh(String name, SDVariable x)```
Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximation
`SDVariable` ```rdiv(SDVariable x, double value)```
Scalar reverse division operation, out = scalar / in
`SDVariable` ```rdiv(SDVariable x, SDVariable y)```
Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```rdiv(String name, SDVariable x, double value)```
Scalar reverse division operation, out = scalar / in
`SDVariable` ```rdiv(String name, SDVariable x, SDVariable y)```
Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` `reciprocal(SDVariable x)`
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]
`SDVariable` ```reciprocal(String name, SDVariable x)```
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]
`SDVariable` `rectifiedTanh(SDVariable x)`
Rectified tanh operation: max(0, tanh(in))
`SDVariable` ```rectifiedTanh(String name, SDVariable x)```
Rectified tanh operation: max(0, tanh(in))
`SDVariable` `round(SDVariable x)`
Element-wise round function: out = round(x).
`SDVariable` ```round(String name, SDVariable x)```
Element-wise round function: out = round(x).
`SDVariable` `rsqrt(SDVariable x)`
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)
`SDVariable` ```rsqrt(String name, SDVariable x)```
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)
`SDVariable` ```rsub(SDVariable x, double value)```
Scalar reverse subtraction operation, out = scalar - in
`SDVariable` ```rsub(SDVariable x, SDVariable y)```
Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```rsub(String name, SDVariable x, double value)```
Scalar reverse subtraction operation, out = scalar - in
`SDVariable` ```rsub(String name, SDVariable x, SDVariable y)```
Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```setDiag(SDVariable in, SDVariable diag)```
Set the diagonal value to the specified values
If input is
[ a, b, c]
[ d, e, f]
[ g, h, i]
and diag = [ 1, 2, 3] then output is
[ 1, b, c]
[ d, 2, f]
[ g, h, 3]
`SDVariable` ```setDiag(String name, SDVariable in, SDVariable diag)```
Set the diagonal value to the specified values
If input is
[ a, b, c]
[ d, e, f]
[ g, h, i]
and diag = [ 1, 2, 3] then output is
[ 1, b, c]
[ d, 2, f]
[ g, h, 3]
`SDVariable` ```shannonEntropy(SDVariable in, int... dimensions)```
Shannon Entropy reduction: -sum(x * log2(x))
`SDVariable` ```shannonEntropy(String name, SDVariable in, int... dimensions)```
Shannon Entropy reduction: -sum(x * log2(x))
`SDVariable` `sign(SDVariable x)`
Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0
`SDVariable` ```sign(String name, SDVariable x)```
Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0
`SDVariable` `sin(SDVariable x)`
Elementwise sine operation: out = sin(x)
`SDVariable` ```sin(String name, SDVariable x)```
Elementwise sine operation: out = sin(x)
`SDVariable` `sinh(SDVariable x)`
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)
`SDVariable` ```sinh(String name, SDVariable x)```
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)
`SDVariable` `sqrt(SDVariable x)`
Element-wise square root function: out = sqrt(x)
`SDVariable` ```sqrt(String name, SDVariable x)```
Element-wise square root function: out = sqrt(x)
`SDVariable` `square(SDVariable x)`
Element-wise square function: out = x^2
`SDVariable` ```square(String name, SDVariable x)```
Element-wise square function: out = x^2
`SDVariable` ```squaredDifference(SDVariable x, SDVariable y)```
Pairwise squared difference operation.
`SDVariable` ```squaredDifference(String name, SDVariable x, SDVariable y)```
Pairwise squared difference operation.
`SDVariable` ```standardize(SDVariable x, int... dimensions)```
Standardize input variable along given axis

out = (x - mean) / stdev

with mean and stdev being calculated along the given dimension.
`SDVariable` ```standardize(String name, SDVariable x, int... dimensions)```
Standardize input variable along given axis

out = (x - mean) / stdev

with mean and stdev being calculated along the given dimension.
`SDVariable` ```step(SDVariable x, double value)```
Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwise
`SDVariable` ```step(String name, SDVariable x, double value)```
Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwise
`SDVariable` ```sub(SDVariable x, double value)```
Scalar subtraction operation, out = in - scalar
`SDVariable` ```sub(SDVariable x, SDVariable y)```
Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` ```sub(String name, SDVariable x, double value)```
Scalar subtraction operation, out = in - scalar
`SDVariable` ```sub(String name, SDVariable x, SDVariable y)```
Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
`SDVariable` `tan(SDVariable x)`
Elementwise tangent operation: out = tan(x)
`SDVariable` ```tan(String name, SDVariable x)```
Elementwise tangent operation: out = tan(x)
`SDVariable` `tanh(SDVariable x)`
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)
`SDVariable` ```tanh(String name, SDVariable x)```
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)
`SDVariable` `trace(SDVariable in)`
Matrix trace operation
For rank 2 matrices, the output is a scalar vith the trace - i.e., sum of the main diagonal.
`SDVariable` ```trace(String name, SDVariable in)```
Matrix trace operation
For rank 2 matrices, the output is a scalar vith the trace - i.e., sum of the main diagonal.
`SDVariable` ```xor(SDVariable x, SDVariable y)```
Boolean XOR (exclusive OR) operation: elementwise (x !
`SDVariable` ```xor(String name, SDVariable x, SDVariable y)```
Boolean XOR (exclusive OR) operation: elementwise (x !
`SDVariable` `zeroFraction(SDVariable input)`
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
`SDVariable` ```zeroFraction(String name, SDVariable input)```
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### SDMath

`public SDMath(SameDiff sameDiff)`
• ### Method Detail

• #### clipByAvgNorm

```public SDVariable clipByAvgNorm(SDVariable x,
double clipValue,
int... dimensions)```
Clips tensor values to a maximum average L2-norm.
Parameters:
`x` - Input variable (NUMERIC type)
`clipValue` - Value for clipping
`dimensions` - Dimensions to reduce over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### clipByAvgNorm

```public SDVariable clipByAvgNorm(String name,
SDVariable x,
double clipValue,
int... dimensions)```
Clips tensor values to a maximum average L2-norm.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`clipValue` - Value for clipping
`dimensions` - Dimensions to reduce over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### embeddingLookup

```public SDVariable embeddingLookup(SDVariable x,
SDVariable indices,
PartitionMode PartitionMode)```
Looks up ids in a list of embedding tensors.
Parameters:
`x` - Input tensor (NUMERIC type)
`indices` - A Tensor containing the ids to be looked up. (INT type)
`PartitionMode` - partition_mode == 0 - i.e. 'mod' , 1 - 'div'
Returns:
output Shifted output (NUMERIC type)
• #### embeddingLookup

```public SDVariable embeddingLookup(String name,
SDVariable x,
SDVariable indices,
PartitionMode PartitionMode)```
Looks up ids in a list of embedding tensors.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input tensor (NUMERIC type)
`indices` - A Tensor containing the ids to be looked up. (INT type)
`PartitionMode` - partition_mode == 0 - i.e. 'mod' , 1 - 'div'
Returns:
output Shifted output (NUMERIC type)
• #### mergeMaxIndex

```public SDVariable mergeMaxIndex(SDVariable[] x,
DataType dataType)```
Return array of max elements indices with along tensor dimensions
Parameters:
`x` - Input tensor (NUMERIC type)
`dataType` - Data type
Returns:
output Array max elements indices with along dimensions. (INT type)
• #### mergeMaxIndex

```public SDVariable mergeMaxIndex(String name,
SDVariable[] x,
DataType dataType)```
Return array of max elements indices with along tensor dimensions
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input tensor (NUMERIC type)
`dataType` - Data type
Returns:
output Array max elements indices with along dimensions. (INT type)
• #### mergeMaxIndex

`public SDVariable mergeMaxIndex(SDVariable... x)`
Return array of max elements indices with along tensor dimensions
Parameters:
`x` - Input tensor (NUMERIC type)
Returns:
output Array max elements indices with along dimensions. (INT type)
• #### mergeMaxIndex

```public SDVariable mergeMaxIndex(String name,
SDVariable... x)```
Return array of max elements indices with along tensor dimensions
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input tensor (NUMERIC type)
Returns:
output Array max elements indices with along dimensions. (INT type)
• #### abs

`public SDVariable abs(SDVariable x)`
Elementwise absolute value operation: out = abs(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### abs

```public SDVariable abs(String name,
SDVariable x)```
Elementwise absolute value operation: out = abs(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### acos

`public SDVariable acos(SDVariable x)`
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### acos

```public SDVariable acos(String name,
SDVariable x)```
Elementwise acos (arccosine, inverse cosine) operation: out = arccos(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### acosh

`public SDVariable acosh(SDVariable x)`
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### acosh

```public SDVariable acosh(String name,
SDVariable x)```
Elementwise acosh (inverse hyperbolic cosine) function: out = acosh(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)

```public SDVariable add(SDVariable x,
SDVariable y)```
Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)

```public SDVariable add(String name,
SDVariable x,
SDVariable y)```
Pairwise addition operation, out = x + y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)

```public SDVariable add(SDVariable x,
double value)```
Scalar add operation, out = in + scalar
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)

```public SDVariable add(String name,
SDVariable x,
double value)```
Scalar add operation, out = in + scalar
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### amax

```public SDVariable amax(SDVariable in,
int... dimensions)```
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### amax

```public SDVariable amax(String name,
SDVariable in,
int... dimensions)```
Absolute max array reduction operation, optionally along specified dimensions: out = max(abs(x))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### amean

```public SDVariable amean(SDVariable in,
int... dimensions)```
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### amean

```public SDVariable amean(String name,
SDVariable in,
int... dimensions)```
Absolute mean array reduction operation, optionally along specified dimensions: out = mean(abs(x))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### amin

```public SDVariable amin(SDVariable in,
int... dimensions)```
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### amin

```public SDVariable amin(String name,
SDVariable in,
int... dimensions)```
Absolute min array reduction operation, optionally along specified dimensions: out = min(abs(x))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### and

```public SDVariable and(SDVariable x,
SDVariable y)```
Boolean AND operation: elementwise (x != 0) && (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
Parameters:
`x` - Input 1 (BOOL type)
`y` - Input 2 (BOOL type)
Returns:
output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
• #### and

```public SDVariable and(String name,
SDVariable x,
SDVariable y)```
Boolean AND operation: elementwise (x != 0) && (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input 1 (BOOL type)
`y` - Input 2 (BOOL type)
Returns:
output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
• #### asin

`public SDVariable asin(SDVariable x)`
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### asin

```public SDVariable asin(String name,
SDVariable x)```
Elementwise asin (arcsin, inverse sine) operation: out = arcsin(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### asinh

`public SDVariable asinh(SDVariable x)`
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### asinh

```public SDVariable asinh(String name,
SDVariable x)```
Elementwise asinh (inverse hyperbolic sine) function: out = asinh(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### asum

```public SDVariable asum(SDVariable in,
int... dimensions)```
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### asum

```public SDVariable asum(String name,
SDVariable in,
int... dimensions)```
Absolute sum array reduction operation, optionally along specified dimensions: out = sum(abs(x))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### atan

`public SDVariable atan(SDVariable x)`
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### atan

```public SDVariable atan(String name,
SDVariable x)```
Elementwise atan (arctangent, inverse tangent) operation: out = arctangent(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### atan2

```public SDVariable atan2(SDVariable y,
SDVariable x)```
Elementwise atan (arctangent, inverse tangent) operation: out = atan2(x,y).
Similar to atan(y/x) but sigts of x and y are used to determine the location of the result
Parameters:
`y` - Input Y variable (NUMERIC type)
`x` - Input X variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### atan2

```public SDVariable atan2(String name,
SDVariable y,
SDVariable x)```
Elementwise atan (arctangent, inverse tangent) operation: out = atan2(x,y).
Similar to atan(y/x) but sigts of x and y are used to determine the location of the result
Parameters:
`name` - name May be null. Name for the output variable
`y` - Input Y variable (NUMERIC type)
`x` - Input X variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### atanh

`public SDVariable atanh(SDVariable x)`
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### atanh

```public SDVariable atanh(String name,
SDVariable x)```
Elementwise atanh (inverse hyperbolic tangent) function: out = atanh(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### bitShift

```public SDVariable bitShift(SDVariable x,
SDVariable shift)```
Bit shift operation
Parameters:
`x` - input (NUMERIC type)
`shift` - shift value (NUMERIC type)
Returns:
output shifted output (NUMERIC type)
• #### bitShift

```public SDVariable bitShift(String name,
SDVariable x,
SDVariable shift)```
Bit shift operation
Parameters:
`name` - name May be null. Name for the output variable
`x` - input (NUMERIC type)
`shift` - shift value (NUMERIC type)
Returns:
output shifted output (NUMERIC type)
• #### bitShiftRight

```public SDVariable bitShiftRight(SDVariable x,
SDVariable shift)```
Right bit shift operation
Parameters:
`x` - Input tensor (NUMERIC type)
`shift` - shift argument (NUMERIC type)
Returns:
output shifted output (NUMERIC type)
• #### bitShiftRight

```public SDVariable bitShiftRight(String name,
SDVariable x,
SDVariable shift)```
Right bit shift operation
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input tensor (NUMERIC type)
`shift` - shift argument (NUMERIC type)
Returns:
output shifted output (NUMERIC type)
• #### bitShiftRotl

```public SDVariable bitShiftRotl(SDVariable x,
SDVariable shift)```
Cyclic bit shift operation
Parameters:
`x` - Input tensor (NUMERIC type)
`shift` - shift argy=ument (NUMERIC type)
Returns:
output shifted output (NUMERIC type)
• #### bitShiftRotl

```public SDVariable bitShiftRotl(String name,
SDVariable x,
SDVariable shift)```
Cyclic bit shift operation
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input tensor (NUMERIC type)
`shift` - shift argy=ument (NUMERIC type)
Returns:
output shifted output (NUMERIC type)
• #### bitShiftRotr

```public SDVariable bitShiftRotr(SDVariable x,
SDVariable shift)```
Cyclic right shift operation
Parameters:
`x` - Input tensor (NUMERIC type)
`shift` - Shift argument (NUMERIC type)
Returns:
output Shifted output (NUMERIC type)
• #### bitShiftRotr

```public SDVariable bitShiftRotr(String name,
SDVariable x,
SDVariable shift)```
Cyclic right shift operation
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input tensor (NUMERIC type)
`shift` - Shift argument (NUMERIC type)
Returns:
output Shifted output (NUMERIC type)
• #### ceil

`public SDVariable ceil(SDVariable x)`
Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### ceil

```public SDVariable ceil(String name,
SDVariable x)```
Element-wise ceiling function: out = ceil(x).
Rounds each value up to the nearest integer value (if not already an integer)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### clipByNorm

```public SDVariable clipByNorm(SDVariable x,
double clipValue,
int... dimensions)```
Clipping by L2 norm, optionally along dimension(s)
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed
Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped according
to the corresponding l2Norm along the specified dimensions
Parameters:
`x` - Input variable (NUMERIC type)
`clipValue` - Clipping value (maximum l2 norm)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### clipByNorm

```public SDVariable clipByNorm(String name,
SDVariable x,
double clipValue,
int... dimensions)```
Clipping by L2 norm, optionally along dimension(s)
if l2Norm(x,dimension) < clipValue, then input is returned unmodifed
Otherwise, out[i] = in[i] * clipValue / l2Norm(in, dimensions) where each value is clipped according
to the corresponding l2Norm along the specified dimensions
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`clipValue` - Clipping value (maximum l2 norm)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### clipByValue

```public SDVariable clipByValue(SDVariable x,
double clipValueMin,
double clipValueMax)```
Element-wise clipping function:
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax
out[i] = clipValueMin if in[i] < clipValueMin
out[i] = clipValueMax if in[i] > clipValueMax
Parameters:
`x` - Input variable (NUMERIC type)
`clipValueMin` - Minimum value for clipping
`clipValueMax` - Maximum value for clipping
Returns:
output Output variable (NUMERIC type)
• #### clipByValue

```public SDVariable clipByValue(String name,
SDVariable x,
double clipValueMin,
double clipValueMax)```
Element-wise clipping function:
out[i] = in[i] if in[i] >= clipValueMin and in[i] <= clipValueMax
out[i] = clipValueMin if in[i] < clipValueMin
out[i] = clipValueMax if in[i] > clipValueMax
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`clipValueMin` - Minimum value for clipping
`clipValueMax` - Maximum value for clipping
Returns:
output Output variable (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(SDVariable labels,
SDVariable pred,
DataType dataType)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1] and predicted = [0, 2, 1] then output is:
[1, 0, 0]
[0, 1, 1]
[0, 0, 0]
Parameters:
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`dataType` - Data type
Returns:
output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(String name,
SDVariable labels,
SDVariable pred,
DataType dataType)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1] and predicted = [0, 2, 1] then output is:
[1, 0, 0]
[0, 1, 1]
[0, 0, 0]
Parameters:
`name` - name May be null. Name for the output variable
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`dataType` - Data type
Returns:
output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(SDVariable labels,
SDVariable pred,
int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
For example, if labels = [0, 1, 1], predicted = [0, 2, 1], and numClasses=4 then output is:
[1, 0, 0, 0]
[0, 1, 1, 0]
[0, 0, 0, 0]
[0, 0, 0, 0]
Parameters:
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`numClasses` - Number of classes
Returns:
output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(String name,
SDVariable labels,
SDVariable pred,
int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
For example, if labels = [0, 1, 1], predicted = [0, 2, 1], and numClasses=4 then output is:
[1, 0, 0, 0]
[0, 1, 1, 0]
[0, 0, 0, 0]
[0, 0, 0, 0]
Parameters:
`name` - name May be null. Name for the output variable
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`numClasses` - Number of classes
Returns:
output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(SDVariable labels,
SDVariable pred,
SDVariable weights)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1], predicted = [0, 2, 1] and weights = [1, 2, 3]
[1, 0, 0]
[0, 3, 2]
[0, 0, 0]
Parameters:
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`weights` - Weights - 1D array of values (may be real/decimal) representing the weight/contribution of each prediction. Must be same length as both labels and predictions arrays (NUMERIC type)
Returns:
output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(String name,
SDVariable labels,
SDVariable pred,
SDVariable weights)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values. This version assumes the number of classes is 1 + max(max(labels), max(pred))
For example, if labels = [0, 1, 1], predicted = [0, 2, 1] and weights = [1, 2, 3]
[1, 0, 0]
[0, 3, 2]
[0, 0, 0]
Parameters:
`name` - name May be null. Name for the output variable
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`weights` - Weights - 1D array of values (may be real/decimal) representing the weight/contribution of each prediction. Must be same length as both labels and predictions arrays (NUMERIC type)
Returns:
output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(SDVariable labels,
SDVariable pred,
SDVariable weights,
int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
For example, if labels = [0, 1, 1], predicted = [0, 2, 1], numClasses = 4, and weights = [1, 2, 3]
[1, 0, 0, 0]
[0, 3, 2, 0]
[0, 0, 0, 0]
[0, 0, 0, 0]
Parameters:
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`weights` - Weights - 1D array of values (may be real/decimal) representing the weight/contribution of each prediction. Must be same length as both labels and predictions arrays (NUMERIC type)
`numClasses` -
Returns:
output Output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### confusionMatrix

```public SDVariable confusionMatrix(String name,
SDVariable labels,
SDVariable pred,
SDVariable weights,
int numClasses)```
Compute the 2d confusion matrix of size [numClasses, numClasses] from a pair of labels and predictions, both of
which are represented as integer values.
For example, if labels = [0, 1, 1], predicted = [0, 2, 1], numClasses = 4, and weights = [1, 2, 3]
[1, 0, 0, 0]
[0, 3, 2, 0]
[0, 0, 0, 0]
[0, 0, 0, 0]
Parameters:
`name` - name May be null. Name for the output variable
`labels` - Labels - 1D array of integer values representing label values (NUMERIC type)
`pred` - Predictions - 1D array of integer values representing predictions. Same length as labels (NUMERIC type)
`weights` - Weights - 1D array of values (may be real/decimal) representing the weight/contribution of each prediction. Must be same length as both labels and predictions arrays (NUMERIC type)
`numClasses` -
Returns:
output Output variable (2D, shape [numClasses, numClasses}) (NUMERIC type)
• #### cos

`public SDVariable cos(SDVariable x)`
Elementwise cosine operation: out = cos(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### cos

```public SDVariable cos(String name,
SDVariable x)```
Elementwise cosine operation: out = cos(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### cosh

`public SDVariable cosh(SDVariable x)`
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### cosh

```public SDVariable cosh(String name,
SDVariable x)```
Elementwise cosh (hyperbolic cosine) operation: out = cosh(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### cosineDistance

```public SDVariable cosineDistance(SDVariable x,
SDVariable y,
int... dimensions)```
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = 1.0 - cosineSimilarity(x,y)
Parameters:
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate cosineDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### cosineDistance

```public SDVariable cosineDistance(String name,
SDVariable x,
SDVariable y,
int... dimensions)```
Cosine distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = 1.0 - cosineSimilarity(x,y)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate cosineDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### cosineSimilarity

```public SDVariable cosineSimilarity(SDVariable x,
SDVariable y,
int... dimensions)```
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)
Parameters:
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate cosineSimilarity over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### cosineSimilarity

```public SDVariable cosineSimilarity(String name,
SDVariable x,
SDVariable y,
int... dimensions)```
Cosine similarity pairwise reduction operation. The output contains the cosine similarity for each tensor/subset
along the specified dimensions:
out = (sum_i x[i] * y[i]) / ( sqrt(sum_i x[i]^2) * sqrt(sum_i y[i]^2)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate cosineSimilarity over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### countNonZero

```public SDVariable countNonZero(SDVariable in,
int... dimensions)```
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### countNonZero

```public SDVariable countNonZero(String name,
SDVariable in,
int... dimensions)```
Count non zero array reduction operation, optionally along specified dimensions: out = count(x != 0)
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### countZero

```public SDVariable countZero(SDVariable in,
int... dimensions)```
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### countZero

```public SDVariable countZero(String name,
SDVariable in,
int... dimensions)```
Count zero array reduction operation, optionally along specified dimensions: out = count(x == 0)
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### cross

```public SDVariable cross(SDVariable a,
SDVariable b)```
Returns the pair-wise cross product of equal size arrays a and b: a x b = ||a||x||b|| sin(theta).
Can take rank 1 or above inputs (of equal shapes), but note that the last dimension must have dimension 3
Parameters:
`a` - First input (NUMERIC type)
`b` - Second input (NUMERIC type)
Returns:
output Element-wise cross product (NUMERIC type)
• #### cross

```public SDVariable cross(String name,
SDVariable a,
SDVariable b)```
Returns the pair-wise cross product of equal size arrays a and b: a x b = ||a||x||b|| sin(theta).
Can take rank 1 or above inputs (of equal shapes), but note that the last dimension must have dimension 3
Parameters:
`name` - name May be null. Name for the output variable
`a` - First input (NUMERIC type)
`b` - Second input (NUMERIC type)
Returns:
output Element-wise cross product (NUMERIC type)
• #### cube

`public SDVariable cube(SDVariable x)`
Element-wise cube function: out = x^3
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### cube

```public SDVariable cube(String name,
SDVariable x)```
Element-wise cube function: out = x^3
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### diag

`public SDVariable diag(SDVariable x)`
Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0
For example, if input = [1,2,3], then output is given by:
[ 1, 0, 0]
[ 0, 2, 0]
[ 0, 0, 3]

Higher input ranks are also supported: if input has shape [a,...,R-1] then output[i,...,k,i,...,k] = input[i,...,k].
i.e., for input rank R, output has rank 2R
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### diag

```public SDVariable diag(String name,
SDVariable x)```
Returns an output variable with diagonal values equal to the specified values; off-diagonal values will be set to 0
For example, if input = [1,2,3], then output is given by:
[ 1, 0, 0]
[ 0, 2, 0]
[ 0, 0, 3]

Higher input ranks are also supported: if input has shape [a,...,R-1] then output[i,...,k,i,...,k] = input[i,...,k].
i.e., for input rank R, output has rank 2R
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### diagPart

`public SDVariable diagPart(SDVariable x)`
Extract the diagonal part from the input array.
If input is
[ 1, 0, 0]
[ 0, 2, 0]
[ 0, 0, 3]
then output is [1, 2, 3].
Supports higher dimensions: in general, out[i,...,k] = in[i,...,k,i,...,k]
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Diagonal part of the input (NUMERIC type)
• #### diagPart

```public SDVariable diagPart(String name,
SDVariable x)```
Extract the diagonal part from the input array.
If input is
[ 1, 0, 0]
[ 0, 2, 0]
[ 0, 0, 3]
then output is [1, 2, 3].
Supports higher dimensions: in general, out[i,...,k] = in[i,...,k,i,...,k]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Diagonal part of the input (NUMERIC type)
• #### div

```public SDVariable div(SDVariable x,
SDVariable y)```
Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### div

```public SDVariable div(String name,
SDVariable x,
SDVariable y)```
Pairwise division operation, out = x / y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### div

```public SDVariable div(SDVariable x,
double value)```
Scalar division operation, out = in / scalar
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### div

```public SDVariable div(String name,
SDVariable x,
double value)```
Scalar division operation, out = in / scalar
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### entropy

```public SDVariable entropy(SDVariable in,
int... dimensions)```
Entropy reduction: -sum(x * log(x))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### entropy

```public SDVariable entropy(String name,
SDVariable in,
int... dimensions)```
Entropy reduction: -sum(x * log(x))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### erf

`public SDVariable erf(SDVariable x)`
Element-wise Gaussian error function - out = erf(in)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### erf

```public SDVariable erf(String name,
SDVariable x)```
Element-wise Gaussian error function - out = erf(in)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### erfc

`public SDVariable erfc(SDVariable x)`
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### erfc

```public SDVariable erfc(String name,
SDVariable x)```
Element-wise complementary Gaussian error function - out = erfc(in) = 1 - erf(in)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### euclideanDistance

```public SDVariable euclideanDistance(SDVariable x,
SDVariable y,
int... dimensions)```
Euclidean distance (l2 norm, l2 distance) reduction operation. The output contains the Euclidean distance for each
tensor/subset along the specified dimensions:
out = sqrt( sum_i (x[i] - y[i])^2 )
Parameters:
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate euclideanDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### euclideanDistance

```public SDVariable euclideanDistance(String name,
SDVariable x,
SDVariable y,
int... dimensions)```
Euclidean distance (l2 norm, l2 distance) reduction operation. The output contains the Euclidean distance for each
tensor/subset along the specified dimensions:
out = sqrt( sum_i (x[i] - y[i])^2 )
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate euclideanDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### exp

`public SDVariable exp(SDVariable x)`
Elementwise exponent function: out = exp(x) = 2.71828...^x
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### exp

```public SDVariable exp(String name,
SDVariable x)```
Elementwise exponent function: out = exp(x) = 2.71828...^x
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### expm1

`public SDVariable expm1(SDVariable x)`
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^x
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### expm1

```public SDVariable expm1(String name,
SDVariable x)```
Elementwise 1.0 - exponent function: out = 1.0 - exp(x) = 1.0 - 2.71828...^x
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### eye

`public SDVariable eye(int rows)`
Generate an identity matrix with the specified number of rows and columns.
Parameters:
`rows` - Number of rows
Returns:
output Identity matrix (NUMERIC type)
• #### eye

```public SDVariable eye(String name,
int rows)```
Generate an identity matrix with the specified number of rows and columns.
Parameters:
`name` - name May be null. Name for the output variable
`rows` - Number of rows
Returns:
output Identity matrix (NUMERIC type)
• #### eye

```public SDVariable eye(int rows,
int cols)```
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE
Parameters:
`rows` - Number of rows
`cols` - Number of columns
Returns:
output (NUMERIC type)
• #### eye

```public SDVariable eye(String name,
int rows,
int cols)```
As per eye(String, int, int, DataType) but with the default datatype, Eye.DEFAULT_DTYPE
Parameters:
`name` - name May be null. Name for the output variable
`rows` - Number of rows
`cols` - Number of columns
Returns:
output (NUMERIC type)
• #### eye

```public SDVariable eye(int rows,
int cols,
DataType dataType,
int... dimensions)```
Generate an identity matrix with the specified number of rows and columns
Example:
```
``` INDArray eye = eye(3,2)<br>
eye:<br>
[ 1, 0]<br>
[ 0, 1]<br>
[ 0, 0]```
```

Parameters:
`rows` - Number of rows
`cols` - Number of columns
`dataType` - Data type
`dimensions` - (Size: AtLeast(min=0))
Returns:
output Identity matrix (NUMERIC type)
• #### eye

```public SDVariable eye(String name,
int rows,
int cols,
DataType dataType,
int... dimensions)```
Generate an identity matrix with the specified number of rows and columns
Example:
```
``` INDArray eye = eye(3,2)<br>
eye:<br>
[ 1, 0]<br>
[ 0, 1]<br>
[ 0, 0]```
```

Parameters:
`name` - name May be null. Name for the output variable
`rows` - Number of rows
`cols` - Number of columns
`dataType` - Data type
`dimensions` - (Size: AtLeast(min=0))
Returns:
output Identity matrix (NUMERIC type)
• #### eye

```public SDVariable eye(SDVariable rows,
SDVariable cols)```
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays
Parameters:
`rows` - Number of rows (INT type)
`cols` - Number of columns (INT type)
Returns:
output Identity matrix (NUMERIC type)
• #### eye

```public SDVariable eye(String name,
SDVariable rows,
SDVariable cols)```
As per eye(int, int) bit with the number of rows/columns specified as scalar INDArrays
Parameters:
`name` - name May be null. Name for the output variable
`rows` - Number of rows (INT type)
`cols` - Number of columns (INT type)
Returns:
output Identity matrix (NUMERIC type)
• #### eye

`public SDVariable eye(SDVariable rows)`
As per eye(String, int) but with the number of rows specified as a scalar INDArray
Parameters:
`rows` - Number of rows (INT type)
Returns:
output SDVaribable identity matrix (NUMERIC type)
• #### eye

```public SDVariable eye(String name,
SDVariable rows)```
As per eye(String, int) but with the number of rows specified as a scalar INDArray
Parameters:
`name` - name May be null. Name for the output variable
`rows` - Number of rows (INT type)
Returns:
output SDVaribable identity matrix (NUMERIC type)
• #### firstIndex

```public SDVariable firstIndex(SDVariable in,
Condition condition,
int... dimensions)```
First index reduction operation.
Returns a variable that contains the index of the first element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### firstIndex

```public SDVariable firstIndex(String name,
SDVariable in,
Condition condition,
int... dimensions)```
First index reduction operation.
Returns a variable that contains the index of the first element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### firstIndex

```public SDVariable firstIndex(SDVariable in,
Condition condition,
boolean keepDims,
int... dimensions)```
First index reduction operation.
Returns a variable that contains the index of the first element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### firstIndex

```public SDVariable firstIndex(String name,
SDVariable in,
Condition condition,
boolean keepDims,
int... dimensions)```
First index reduction operation.
Returns a variable that contains the index of the first element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### floor

`public SDVariable floor(SDVariable x)`
Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### floor

```public SDVariable floor(String name,
SDVariable x)```
Element-wise floor function: out = floor(x).
Rounds each value down to the nearest integer value (if not already an integer)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### floorDiv

```public SDVariable floorDiv(SDVariable x,
SDVariable y)```
Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### floorDiv

```public SDVariable floorDiv(String name,
SDVariable x,
SDVariable y)```
Pairwise floor division operation, out = floor(x / y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### floorMod

```public SDVariable floorMod(SDVariable x,
SDVariable y)```
Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### floorMod

```public SDVariable floorMod(String name,
SDVariable x,
SDVariable y)```
Pairwise Modulus division operation
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### floorMod

```public SDVariable floorMod(SDVariable x,
double value)```
Scalar floor modulus operation
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### floorMod

```public SDVariable floorMod(String name,
SDVariable x,
double value)```
Scalar floor modulus operation
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### hammingDistance

```public SDVariable hammingDistance(SDVariable x,
SDVariable y,
int... dimensions)```
Hamming distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = count( x[i] != y[i] )
Parameters:
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate hammingDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### hammingDistance

```public SDVariable hammingDistance(String name,
SDVariable x,
SDVariable y,
int... dimensions)```
Hamming distance reduction operation. The output contains the cosine distance for each
tensor/subset along the specified dimensions:
out = count( x[i] != y[i] )
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate hammingDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### iamax

```public SDVariable iamax(SDVariable in,
int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamax

```public SDVariable iamax(String name,
SDVariable in,
int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamax

```public SDVariable iamax(SDVariable in,
boolean keepDims,
int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
Parameters:
`in` - Input variable (NUMERIC type)
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamax

```public SDVariable iamax(String name,
SDVariable in,
boolean keepDims,
int... dimensions)```
Index of the max absolute value: argmax(abs(in))
see argmax(String, INDArray, boolean, int...)
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamin

```public SDVariable iamin(SDVariable in,
int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamin

```public SDVariable iamin(String name,
SDVariable in,
int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamin

```public SDVariable iamin(SDVariable in,
boolean keepDims,
int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
Parameters:
`in` - Input variable (NUMERIC type)
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### iamin

```public SDVariable iamin(String name,
SDVariable in,
boolean keepDims,
int... dimensions)```
Index of the min absolute value: argmin(abs(in))
see argmin(String, INDArray, boolean, int...)
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### isFinite

`public SDVariable isFinite(SDVariable x)`
Is finite operation: elementwise isFinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isFinite

```public SDVariable isFinite(String name,
SDVariable x)```
Is finite operation: elementwise isFinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isInfinite

`public SDVariable isInfinite(SDVariable x)`
Is infinite operation: elementwise isInfinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isInfinite

```public SDVariable isInfinite(String name,
SDVariable x)```
Is infinite operation: elementwise isInfinite(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isMax

`public SDVariable isMax(SDVariable x)`
Is maximum operation: elementwise x == max(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isMax

```public SDVariable isMax(String name,
SDVariable x)```
Is maximum operation: elementwise x == max(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isNaN

`public SDVariable isNaN(SDVariable x)`
Is Not a Number operation: elementwise isNaN(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isNaN

```public SDVariable isNaN(String name,
SDVariable x)```
Is Not a Number operation: elementwise isNaN(x)
Returns an array with the same shape/size as the input, with values 1 where condition is satisfied, or
value 0 otherwise
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### isNonDecreasing

`public SDVariable isNonDecreasing(SDVariable x)`
Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Scalar variable with value 1 if non-decreasing, or 0 otherwise (NUMERIC type)
• #### isNonDecreasing

```public SDVariable isNonDecreasing(String name,
SDVariable x)```
Is the array non decreasing?
An array is non-decreasing if for every valid i, x[i] <= x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Scalar variable with value 1 if non-decreasing, or 0 otherwise (NUMERIC type)
• #### isStrictlyIncreasing

`public SDVariable isStrictlyIncreasing(SDVariable x)`
Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Scalar variable with value 1 if strictly increasing, or 0 otherwise (NUMERIC type)
• #### isStrictlyIncreasing

```public SDVariable isStrictlyIncreasing(String name,
SDVariable x)```
Is the array strictly increasing?
An array is strictly increasing if for every valid i, x[i] < x[i+1]. For Rank 2+ arrays, values are compared
in 'c' (row major) order
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Scalar variable with value 1 if strictly increasing, or 0 otherwise (NUMERIC type)
• #### jaccardDistance

```public SDVariable jaccardDistance(SDVariable x,
SDVariable y,
int... dimensions)```
Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.
Parameters:
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate jaccardDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### jaccardDistance

```public SDVariable jaccardDistance(String name,
SDVariable x,
SDVariable y,
int... dimensions)```
Jaccard similarity reduction operation. The output contains the Jaccard distance for each
tensor along the specified dimensions.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate jaccardDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### lastIndex

```public SDVariable lastIndex(SDVariable in,
Condition condition,
int... dimensions)```
Last index reduction operation.
Returns a variable that contains the index of the last element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### lastIndex

```public SDVariable lastIndex(String name,
SDVariable in,
Condition condition,
int... dimensions)```
Last index reduction operation.
Returns a variable that contains the index of the last element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### lastIndex

```public SDVariable lastIndex(SDVariable in,
Condition condition,
boolean keepDims,
int... dimensions)```
Last index reduction operation.
Returns a variable that contains the index of the last element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### lastIndex

```public SDVariable lastIndex(String name,
SDVariable in,
Condition condition,
boolean keepDims,
int... dimensions)```
Last index reduction operation.
Returns a variable that contains the index of the last element that matches the specified condition (for each
slice along the specified dimensions)
Note that if keepDims = true, the output variable has the same rank as the input variable,
with the reduced dimensions having size 1. This can be useful for later broadcast operations (such as subtracting
the mean along a dimension).
Example: if input has shape [a,b,c] and dimensions= then output has shape:
keepDims = true: [a,1,c]
keepDims = false: [a,c]
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`condition` - Condition to check on input variable
`keepDims` - If true: keep the dimensions that are reduced on (as length 1). False: remove the reduction dimensions
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=1))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### listDiff

```public SDVariable[] listDiff(SDVariable x,
SDVariable y)```
Calculates difference between inputs X and Y.
Parameters:
`x` - Input variable X (NUMERIC type)
`y` - Input variable Y (NUMERIC type)
• #### listDiff

```public SDVariable[] listDiff(String[] names,
SDVariable x,
SDVariable y)```
Calculates difference between inputs X and Y.
Parameters:
`names` - names May be null. Arrays of names for the output variables.
`x` - Input variable X (NUMERIC type)
`y` - Input variable Y (NUMERIC type)
• #### log

`public SDVariable log(SDVariable x)`
Element-wise logarithm function (base e - natural logarithm): out = log(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### log

```public SDVariable log(String name,
SDVariable x)```
Element-wise logarithm function (base e - natural logarithm): out = log(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### log

```public SDVariable log(SDVariable x,
double base)```
Element-wise logarithm function (with specified base): out = log_{base}(x)
Parameters:
`x` - Input variable (NUMERIC type)
`base` - Logarithm base
Returns:
output Output variable (NUMERIC type)
• #### log

```public SDVariable log(String name,
SDVariable x,
double base)```
Element-wise logarithm function (with specified base): out = log_{base}(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`base` - Logarithm base
Returns:
output Output variable (NUMERIC type)
• #### log1p

`public SDVariable log1p(SDVariable x)`
Elementwise natural logarithm function: out = log_e (1 + x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### log1p

```public SDVariable log1p(String name,
SDVariable x)```
Elementwise natural logarithm function: out = log_e (1 + x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### logEntropy

```public SDVariable logEntropy(SDVariable in,
int... dimensions)```
Log entropy reduction: log(-sum(x * log(x)))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### logEntropy

```public SDVariable logEntropy(String name,
SDVariable in,
int... dimensions)```
Log entropy reduction: log(-sum(x * log(x)))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### logSumExp

```public SDVariable logSumExp(SDVariable input,
int... dimensions)```
Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x))
Parameters:
`input` - Input variable (NUMERIC type)
`dimensions` - Optional dimensions to reduce along (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### logSumExp

```public SDVariable logSumExp(String name,
SDVariable input,
int... dimensions)```
Log-sum-exp reduction (optionally along dimension).
Computes log(sum(exp(x))
Parameters:
`name` - name May be null. Name for the output variable
`input` - Input variable (NUMERIC type)
`dimensions` - Optional dimensions to reduce along (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### manhattanDistance

```public SDVariable manhattanDistance(SDVariable x,
SDVariable y,
int... dimensions)```
Manhattan distance (l1 norm, l1 distance) reduction operation. The output contains the Manhattan distance for each
tensor/subset along the specified dimensions:
out = sum_i abs(x[i]-y[i])
Parameters:
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate manhattanDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### manhattanDistance

```public SDVariable manhattanDistance(String name,
SDVariable x,
SDVariable y,
int... dimensions)```
Manhattan distance (l1 norm, l1 distance) reduction operation. The output contains the Manhattan distance for each
tensor/subset along the specified dimensions:
out = sum_i abs(x[i]-y[i])
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable x (NUMERIC type)
`y` - Input variable y (NUMERIC type)
`dimensions` - Dimensions to calculate manhattanDistance over (Size: AtLeast(min=0))
Returns:
output Output variable (NUMERIC type)
• #### matrixDeterminant

`public SDVariable matrixDeterminant(SDVariable in)`
Matrix determinant op. For 2D input, this returns the standard matrix determinant.
For higher dimensional input with shape [..., m, m] the matrix determinant is returned for each
shape [m,m] sub-matrix.
Parameters:
`in` - Input (NUMERIC type)
Returns:
output Matrix determinant variable (NUMERIC type)
• #### matrixDeterminant

```public SDVariable matrixDeterminant(String name,
SDVariable in)```
Matrix determinant op. For 2D input, this returns the standard matrix determinant.
For higher dimensional input with shape [..., m, m] the matrix determinant is returned for each
shape [m,m] sub-matrix.
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input (NUMERIC type)
Returns:
output Matrix determinant variable (NUMERIC type)
• #### matrixInverse

`public SDVariable matrixInverse(SDVariable in)`
Matrix inverse op. For 2D input, this returns the standard matrix inverse.
For higher dimensional input with shape [..., m, m] the matrix inverse is returned for each
shape [m,m] sub-matrix.
Parameters:
`in` - Input (NUMERIC type)
Returns:
output Matrix inverse variable (NUMERIC type)
• #### matrixInverse

```public SDVariable matrixInverse(String name,
SDVariable in)```
Matrix inverse op. For 2D input, this returns the standard matrix inverse.
For higher dimensional input with shape [..., m, m] the matrix inverse is returned for each
shape [m,m] sub-matrix.
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input (NUMERIC type)
Returns:
output Matrix inverse variable (NUMERIC type)
• #### max

```public SDVariable max(SDVariable x,
SDVariable y)```
Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - First input variable, x (NUMERIC type)
`y` - Second input variable, y (NUMERIC type)
Returns:
out Output (NUMERIC type)
• #### max

```public SDVariable max(String name,
SDVariable x,
SDVariable y)```
Pairwise max operation, out = max(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - First input variable, x (NUMERIC type)
`y` - Second input variable, y (NUMERIC type)
Returns:
out Output (NUMERIC type)

`public SDVariable mergeAdd(SDVariable... inputs)`
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]
Parameters:
`inputs` - Input variables (NUMERIC type)
Returns:
output Output variable (NUMERIC type)

```public SDVariable mergeAdd(String name,
SDVariable... inputs)```
Merge add function: merges an arbitrary number of equal shaped arrays using element-wise addition:
out = sum_i in[i]
Parameters:
`name` - name May be null. Name for the output variable
`inputs` - Input variables (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mergeAvg

`public SDVariable mergeAvg(SDVariable... inputs)`
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]
Parameters:
`inputs` - Input variables (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mergeAvg

```public SDVariable mergeAvg(String name,
SDVariable... inputs)```
Merge average function: merges an arbitrary number of equal shaped arrays using element-wise mean operation:
out = mean_i in[i]
Parameters:
`name` - name May be null. Name for the output variable
`inputs` - Input variables (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mergeMax

`public SDVariable mergeMax(SDVariable... inputs)`
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]
Parameters:
`inputs` - Input variables (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mergeMax

```public SDVariable mergeMax(String name,
SDVariable... inputs)```
Merge max function: merges an arbitrary number of equal shaped arrays using element-wise maximum operation:
out = max_i in[i]
Parameters:
`name` - name May be null. Name for the output variable
`inputs` - Input variables (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### meshgrid

```public SDVariable[] meshgrid(SDVariable[] inputs,
boolean cartesian)```
Broadcasts parameters for evaluation on an N-D grid.
Parameters:
`inputs` - (NUMERIC type)
`cartesian` -
• #### meshgrid

```public SDVariable[] meshgrid(String[] names,
SDVariable[] inputs,
boolean cartesian)```
Broadcasts parameters for evaluation on an N-D grid.
Parameters:
`names` - names May be null. Arrays of names for the output variables.
`inputs` - (NUMERIC type)
`cartesian` -
• #### min

```public SDVariable min(SDVariable x,
SDVariable y)```
Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - First input variable, x (NUMERIC type)
`y` - Second input variable, y (NUMERIC type)
Returns:
out Output (NUMERIC type)
• #### min

```public SDVariable min(String name,
SDVariable x,
SDVariable y)```
Pairwise max operation, out = min(x, y)
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - First input variable, x (NUMERIC type)
`y` - Second input variable, y (NUMERIC type)
Returns:
out Output (NUMERIC type)
• #### mod

```public SDVariable mod(SDVariable x,
SDVariable y)```
Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mod

```public SDVariable mod(String name,
SDVariable x,
SDVariable y)```
Pairwise modulus (remainder) operation, out = x % y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### moments

```public SDVariable[] moments(SDVariable input,
int... axes)```
Calculate the mean and (population) variance for the input variable, for the specified axis
Parameters:
`input` - Input to calculate moments for (NUMERIC type)
`axes` - Dimensions to perform calculation over (Size: AtLeast(min=0))
• #### moments

```public SDVariable[] moments(String[] names,
SDVariable input,
int... axes)```
Calculate the mean and (population) variance for the input variable, for the specified axis
Parameters:
`names` - names May be null. Arrays of names for the output variables.
`input` - Input to calculate moments for (NUMERIC type)
`axes` - Dimensions to perform calculation over (Size: AtLeast(min=0))
• #### mul

```public SDVariable mul(SDVariable x,
SDVariable y)```
Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mul

```public SDVariable mul(String name,
SDVariable x,
SDVariable y)```
Pairwise multiplication operation, out = x * y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### mul

```public SDVariable mul(SDVariable x,
double value)```
Scalar multiplication operation, out = in * scalar
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### mul

```public SDVariable mul(String name,
SDVariable x,
double value)```
Scalar multiplication operation, out = in * scalar
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### neg

`public SDVariable neg(SDVariable x)`
Elementwise negative operation: out = -x
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### neg

```public SDVariable neg(String name,
SDVariable x)```
Elementwise negative operation: out = -x
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### normalizeMoments

```public SDVariable[] normalizeMoments(SDVariable counts,
SDVariable means,
SDVariable variances,
double shift)```
Calculate the mean and variance from the sufficient statistics
Parameters:
`counts` - Rank 0 (scalar) value with the total number of values used to calculate the sufficient statistics (NUMERIC type)
`means` - Mean-value sufficient statistics: this is the SUM of all data values (NUMERIC type)
`variances` - Variaance sufficient statistics: this is the squared sum of all data values (NUMERIC type)
`shift` - Shift value, possibly 0, used when calculating the sufficient statistics (for numerical stability)
• #### normalizeMoments

```public SDVariable[] normalizeMoments(String[] names,
SDVariable counts,
SDVariable means,
SDVariable variances,
double shift)```
Calculate the mean and variance from the sufficient statistics
Parameters:
`names` - names May be null. Arrays of names for the output variables.
`counts` - Rank 0 (scalar) value with the total number of values used to calculate the sufficient statistics (NUMERIC type)
`means` - Mean-value sufficient statistics: this is the SUM of all data values (NUMERIC type)
`variances` - Variaance sufficient statistics: this is the squared sum of all data values (NUMERIC type)
`shift` - Shift value, possibly 0, used when calculating the sufficient statistics (for numerical stability)
• #### or

```public SDVariable or(SDVariable x,
SDVariable y)```
Boolean OR operation: elementwise (x != 0) || (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
Parameters:
`x` - Input 1 (BOOL type)
`y` - Input 2 (BOOL type)
Returns:
output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
• #### or

```public SDVariable or(String name,
SDVariable x,
SDVariable y)```
Boolean OR operation: elementwise (x != 0) || (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input 1 (BOOL type)
`y` - Input 2 (BOOL type)
Returns:
output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
• #### pow

```public SDVariable pow(SDVariable x,
double value)```
Element-wise power function: out = x^value
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### pow

```public SDVariable pow(String name,
SDVariable x,
double value)```
Element-wise power function: out = x^value
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### pow

```public SDVariable pow(SDVariable x,
SDVariable y)```
Element-wise (broadcastable) power function: out = x[i]^y[i]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Power (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### pow

```public SDVariable pow(String name,
SDVariable x,
SDVariable y)```
Element-wise (broadcastable) power function: out = x[i]^y[i]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Power (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rationalTanh

`public SDVariable rationalTanh(SDVariable x)`
Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximation
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rationalTanh

```public SDVariable rationalTanh(String name,
SDVariable x)```
Rational Tanh Approximation elementwise function, as described in the paper:
Compact Convolutional Neural Network Cascade for Face Detection
This is a faster Tanh approximation
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rdiv

```public SDVariable rdiv(SDVariable x,
SDVariable y)```
Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rdiv

```public SDVariable rdiv(String name,
SDVariable x,
SDVariable y)```
Pairwise reverse division operation, out = y / x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rdiv

```public SDVariable rdiv(SDVariable x,
double value)```
Scalar reverse division operation, out = scalar / in
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### rdiv

```public SDVariable rdiv(String name,
SDVariable x,
double value)```
Scalar reverse division operation, out = scalar / in
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### reciprocal

`public SDVariable reciprocal(SDVariable x)`
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### reciprocal

```public SDVariable reciprocal(String name,
SDVariable x)```
Element-wise reciprocal (inverse) function: out[i] = 1 / in[i]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rectifiedTanh

`public SDVariable rectifiedTanh(SDVariable x)`
Rectified tanh operation: max(0, tanh(in))
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rectifiedTanh

```public SDVariable rectifiedTanh(String name,
SDVariable x)```
Rectified tanh operation: max(0, tanh(in))
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### round

`public SDVariable round(SDVariable x)`
Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value.
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### round

```public SDVariable round(String name,
SDVariable x)```
Element-wise round function: out = round(x).
Rounds (up or down depending on value) to the nearest integer value.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rsqrt

`public SDVariable rsqrt(SDVariable x)`
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rsqrt

```public SDVariable rsqrt(String name,
SDVariable x)```
Element-wise reciprocal (inverse) of square root: out = 1.0 / sqrt(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rsub

```public SDVariable rsub(SDVariable x,
SDVariable y)```
Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rsub

```public SDVariable rsub(String name,
SDVariable x,
SDVariable y)```
Pairwise reverse subtraction operation, out = y - x
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### rsub

```public SDVariable rsub(SDVariable x,
double value)```
Scalar reverse subtraction operation, out = scalar - in
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### rsub

```public SDVariable rsub(String name,
SDVariable x,
double value)```
Scalar reverse subtraction operation, out = scalar - in
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### setDiag

```public SDVariable setDiag(SDVariable in,
SDVariable diag)```
Set the diagonal value to the specified values
If input is
[ a, b, c]
[ d, e, f]
[ g, h, i]
and diag = [ 1, 2, 3] then output is
[ 1, b, c]
[ d, 2, f]
[ g, h, 3]
Parameters:
`in` - Input variable (NUMERIC type)
`diag` - Diagonal (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### setDiag

```public SDVariable setDiag(String name,
SDVariable in,
SDVariable diag)```
Set the diagonal value to the specified values
If input is
[ a, b, c]
[ d, e, f]
[ g, h, i]
and diag = [ 1, 2, 3] then output is
[ 1, b, c]
[ d, 2, f]
[ g, h, 3]
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`diag` - Diagonal (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### shannonEntropy

```public SDVariable shannonEntropy(SDVariable in,
int... dimensions)```
Shannon Entropy reduction: -sum(x * log2(x))
Parameters:
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### shannonEntropy

```public SDVariable shannonEntropy(String name,
SDVariable in,
int... dimensions)```
Shannon Entropy reduction: -sum(x * log2(x))
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
`dimensions` - Dimensions to reduce over. If dimensions are not specified, full array reduction is performed (Size: AtLeast(min=0))
Returns:
output Reduced array of rank (input rank - num dimensions) (NUMERIC type)
• #### sign

`public SDVariable sign(SDVariable x)`
Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sign

```public SDVariable sign(String name,
SDVariable x)```
Element-wise sign (signum) function:
out = -1 if in < 0
out = 0 if in = 0
out = 1 if in > 0
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sin

`public SDVariable sin(SDVariable x)`
Elementwise sine operation: out = sin(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sin

```public SDVariable sin(String name,
SDVariable x)```
Elementwise sine operation: out = sin(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sinh

`public SDVariable sinh(SDVariable x)`
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sinh

```public SDVariable sinh(String name,
SDVariable x)```
Elementwise sinh (hyperbolic sine) operation: out = sinh(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sqrt

`public SDVariable sqrt(SDVariable x)`
Element-wise square root function: out = sqrt(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sqrt

```public SDVariable sqrt(String name,
SDVariable x)```
Element-wise square root function: out = sqrt(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### square

`public SDVariable square(SDVariable x)`
Element-wise square function: out = x^2
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### square

```public SDVariable square(String name,
SDVariable x)```
Element-wise square function: out = x^2
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### squaredDifference

```public SDVariable squaredDifference(SDVariable x,
SDVariable y)```
Pairwise squared difference operation.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### squaredDifference

```public SDVariable squaredDifference(String name,
SDVariable x,
SDVariable y)```
Pairwise squared difference operation.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### standardize

```public SDVariable standardize(SDVariable x,
int... dimensions)```
Standardize input variable along given axis

out = (x - mean) / stdev

with mean and stdev being calculated along the given dimension.

For example: given x as a mini batch of the shape [numExamples, exampleLength]:

• use dimension 1 too use the statistics (mean, stdev) for each example

• use dimension 0 if you want to use the statistics for each column across all examples

• use dimensions 0,1 if you want to use the statistics across all columns and examples

Parameters:
`x` - Input variable (NUMERIC type)
`dimensions` - (Size: AtLeast(min=1))
Returns:
output Output variable (NUMERIC type)
• #### standardize

```public SDVariable standardize(String name,
SDVariable x,
int... dimensions)```
Standardize input variable along given axis

out = (x - mean) / stdev

with mean and stdev being calculated along the given dimension.

For example: given x as a mini batch of the shape [numExamples, exampleLength]:

• use dimension 1 too use the statistics (mean, stdev) for each example

• use dimension 0 if you want to use the statistics for each column across all examples

• use dimensions 0,1 if you want to use the statistics across all columns and examples

Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`dimensions` - (Size: AtLeast(min=1))
Returns:
output Output variable (NUMERIC type)
• #### step

```public SDVariable step(SDVariable x,
double value)```
Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwise
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### step

```public SDVariable step(String name,
SDVariable x,
double value)```
Elementwise step function:
out(x) = 1 if x >= cutoff
out(x) = 0 otherwise
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### sub

```public SDVariable sub(SDVariable x,
SDVariable y)```
Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sub

```public SDVariable sub(String name,
SDVariable x,
SDVariable y)```
Pairwise subtraction operation, out = x - y
Note: supports broadcasting if x and y have different shapes and are broadcastable.
For example, if X has shape [1,10] and Y has shape [5,10] then op(X,Y) has output shape [5,10]
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`y` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### sub

```public SDVariable sub(SDVariable x,
double value)```
Scalar subtraction operation, out = in - scalar
Parameters:
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### sub

```public SDVariable sub(String name,
SDVariable x,
double value)```
Scalar subtraction operation, out = in - scalar
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
`value` - Scalar value for op
Returns:
output Output variable (NUMERIC type)
• #### tan

`public SDVariable tan(SDVariable x)`
Elementwise tangent operation: out = tan(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### tan

```public SDVariable tan(String name,
SDVariable x)```
Elementwise tangent operation: out = tan(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### tanh

`public SDVariable tanh(SDVariable x)`
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)
Parameters:
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### tanh

```public SDVariable tanh(String name,
SDVariable x)```
Elementwise tanh (hyperbolic tangent) operation: out = tanh(x)
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input variable (NUMERIC type)
Returns:
output Output variable (NUMERIC type)
• #### trace

`public SDVariable trace(SDVariable in)`
Matrix trace operation
For rank 2 matrices, the output is a scalar vith the trace - i.e., sum of the main diagonal.
For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])
Parameters:
`in` - Input variable (NUMERIC type)
Returns:
output Trace (NUMERIC type)
• #### trace

```public SDVariable trace(String name,
SDVariable in)```
Matrix trace operation
For rank 2 matrices, the output is a scalar vith the trace - i.e., sum of the main diagonal.
For higher rank inputs, output[a,b,c] = trace(in[a,b,c,:,:])
Parameters:
`name` - name May be null. Name for the output variable
`in` - Input variable (NUMERIC type)
Returns:
output Trace (NUMERIC type)
• #### xor

```public SDVariable xor(SDVariable x,
SDVariable y)```
Boolean XOR (exclusive OR) operation: elementwise (x != 0) XOR (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
Parameters:
`x` - Input 1 (BOOL type)
`y` - Input 2 (BOOL type)
Returns:
output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
• #### xor

```public SDVariable xor(String name,
SDVariable x,
SDVariable y)```
Boolean XOR (exclusive OR) operation: elementwise (x != 0) XOR (y != 0)
If x and y arrays have equal shape, the output shape is the same as these inputs.
Note: supports broadcasting if x and y have different shapes and are broadcastable.
Returns an array with values 1 where condition is satisfied, or value 0 otherwise.
Parameters:
`name` - name May be null. Name for the output variable
`x` - Input 1 (BOOL type)
`y` - Input 2 (BOOL type)
Returns:
output INDArray with values 0 and 1 based on where the condition is satisfied (BOOL type)
• #### zeroFraction

`public SDVariable zeroFraction(SDVariable input)`
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
Parameters:
`input` - Input variable (NUMERIC type)
Returns:
output Reduced array of rank 0 (scalar) (NUMERIC type)
• #### zeroFraction

```public SDVariable zeroFraction(String name,
SDVariable input)```
Full array zero fraction array reduction operation, optionally along specified dimensions: out = (count(x == 0) / length(x))
Parameters:
`name` - name May be null. Name for the output variable
`input` - Input variable (NUMERIC type)
Returns:
output Reduced array of rank 0 (scalar) (NUMERIC type)