Interface IOps
Interfaces for backend implementers see ModelBuilder.cs for detail on layers.
Namespace: Unity.Barracuda
Syntax
public interface IOps : IOpsStatistics
Methods
Abs(Tensor)
Abs
Declaration
Tensor Abs(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Acos(Tensor)
Acos
Declaration
Tensor Acos(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Acosh(Tensor)
Acosh
Declaration
Tensor Acosh(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Add(Tensor[])
Add tensors together
Declaration
Tensor Add(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ArgMax(Tensor, Int32)
ArgMax
Declaration
Tensor ArgMax(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ArgMin(Tensor, Int32)
ArgMax
Declaration
Tensor ArgMin(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Asin(Tensor)
Asin
Declaration
Tensor Asin(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Asinh(Tensor)
Asinh
Declaration
Tensor Asinh(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Atan(Tensor)
Atan
Declaration
Tensor Atan(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Atanh(Tensor)
Atanh
Declaration
Tensor Atanh(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
AvgPool2D(Tensor, Int32[], Int32[], Int32[])
2D average pooling
Declaration
Tensor AvgPool2D(Tensor x, int[] pool, int[] stride, int[] pad)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pool | pooling |
| Int32[] | stride | stride |
| Int32[] | pad | padding |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Border2D(Tensor, Int32[], Single)
2D border padding
Declaration
Tensor Border2D(Tensor x, int[] pad, float borderValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pad | padding |
| Single | borderValue | border value |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Border3D(Tensor, Int32[], Single)
3D border padding
Declaration
Tensor Border3D(Tensor x, int[] pad, float borderValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pad | padding |
| Single | borderValue | border value |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Ceil(Tensor)
Ceil
Declaration
Tensor Ceil(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Clip(Tensor, Single, Single)
Clip
Declaration
Tensor Clip(Tensor x, float min, float max)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | min | min value |
| Single | max | max value |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Concat(Tensor[], Int32)
Concatenate tensors across axis
Declaration
Tensor Concat(Tensor[] tensors, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ConstantOfShape(TensorShape, DataType, Single)
Creates a constant of shape input
Declaration
Tensor ConstantOfShape(TensorShape X, DataType type, float value = 0F)
Parameters
| Type | Name | Description |
|---|---|---|
| TensorShape | X | input shape |
| DataType | type | Tensor DataType |
| Single | value | value |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Conv2D(Tensor, Tensor, Tensor, Int32[], Int32[], Layer.FusedActivation)
2D convolution
Declaration
Tensor Conv2D(Tensor x, Tensor k, Tensor b, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | k | kernel |
| Tensor | b | bias |
| Int32[] | stride | stride |
| Int32[] | pad | padding |
| Layer.FusedActivation | fusedActivation | fused activation type |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Conv2DTrans(Tensor, Tensor, Tensor, Int32[], Int32[], Int32[], Layer.FusedActivation)
Transpose 2D convolution
Declaration
Tensor Conv2DTrans(Tensor x, Tensor k, Tensor b, int[] stride, int[] pad, int[] outputAdjustment, Layer.FusedActivation fusedActivation)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | k | kernel |
| Tensor | b | bias |
| Int32[] | stride | stride |
| Int32[] | pad | padding |
| Int32[] | outputAdjustment | output adjustments |
| Layer.FusedActivation | fusedActivation | fused activation type |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Conv3D(Tensor, Tensor, Tensor, Int32[], Int32[], Layer.FusedActivation)
3D convolution
Declaration
Tensor Conv3D(Tensor x, Tensor k, Tensor b, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | k | kernel |
| Tensor | b | bias |
| Int32[] | stride | stride |
| Int32[] | pad | padding |
| Layer.FusedActivation | fusedActivation | fused activation type |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Copy(Tensor)
Copy
Declaration
Tensor Copy(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Cos(Tensor)
Cos
Declaration
Tensor Cos(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Cosh(Tensor)
Cosh
Declaration
Tensor Cosh(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Dense(Tensor, Tensor, Tensor, Layer.FusedActivation)
Dense layer (matrix multiplication) o = x ⨯ w + b
Declaration
Tensor Dense(Tensor x, Tensor w, Tensor b, Layer.FusedActivation fusedActivation)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | x argument |
| Tensor | w | w argument |
| Tensor | b | bias argument |
| Layer.FusedActivation | fusedActivation | fused activation type |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Dense3(Tensor, Tensor, Tensor)
rank3 Dense layer (matrix multiplication) o = x ⨯ w + b
O: N,,W,C / X: N,,W,C / W:N,,,C / B:N,,,_
Declaration
Tensor Dense3(Tensor x, Tensor w, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | x argument (rank3) |
| Tensor | w | w argument (rank2) |
| Tensor | b | bias argument (rank1) |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
DepthToSpace(Tensor, Int32[], Layer.DepthToSpaceMode)
Depth to space
Declaration
Tensor DepthToSpace(Tensor x, int[] scale, Layer.DepthToSpaceMode mode)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | scale | scale |
| Layer.DepthToSpaceMode | mode | mode |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
DepthwiseConv2D(Tensor, Tensor, Tensor, Int32[], Int32[], Layer.FusedActivation)
Depthwise 2D convolution
Declaration
Tensor DepthwiseConv2D(Tensor x, Tensor k, Tensor b, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | k | kernel |
| Tensor | b | bias |
| Int32[] | stride | stride |
| Int32[] | pad | padding |
| Layer.FusedActivation | fusedActivation | fused activation type |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Div(Tensor[])
Divide tensors o = tensors[0] / tensors[1] / ... / tensors[N-1]
Declaration
Tensor Div(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Dropout(Tensor, Single)
Dropout
Declaration
Tensor Dropout(Tensor x, float alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Elu(Tensor, Single)
ELU
Declaration
Tensor Elu(Tensor x, float alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Equal(Tensor, Tensor)
Equal
Declaration
Tensor Equal(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
Erf(Tensor)
Erf
Declaration
Tensor Erf(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Exp(Tensor)
Exponent e^x
Declaration
Tensor Exp(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Expand(Tensor, TensorShape)
Expand
Declaration
Tensor Expand(Tensor x, TensorShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| TensorShape | shape | new shape |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Flatten(Tensor)
Flatten
Declaration
Tensor Flatten(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Floor(Tensor)
Floor
Declaration
Tensor Floor(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Gather(Tensor[], Int32)
Gather
Declaration
Tensor Gather(Tensor[] tensors, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
GetModelExecutionsReporter()
Get model executions reporter
Declaration
IModelExecutionsReporter GetModelExecutionsReporter()
Returns
| Type | Description |
|---|---|
| IModelExecutionsReporter | model executions reporter |
GlobalAvgPool2D(Tensor)
2D global average pooling
Declaration
Tensor GlobalAvgPool2D(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
GlobalAvgVariancePool2D(Tensor)
2D global average variance pooling
Declaration
Tensor GlobalAvgVariancePool2D(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
GlobalMaxPool2D(Tensor)
2D global max pooling
Declaration
Tensor GlobalMaxPool2D(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Greater(Tensor, Tensor)
Greater
Declaration
Tensor Greater(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
GreaterEqual(Tensor, Tensor)
Greater or equal
Declaration
Tensor GreaterEqual(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
HardSigmoid(Tensor, Single, Single)
HardSigmoid
Declaration
Tensor HardSigmoid(Tensor x, float alpha, float beta)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
| Single | beta |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
LeakyRelu(Tensor, Single)
Leaky ReLU
Declaration
Tensor LeakyRelu(Tensor x, float alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Less(Tensor, Tensor)
Less
Declaration
Tensor Less(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
LessEqual(Tensor, Tensor)
Less or equal
Declaration
Tensor LessEqual(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
Log(Tensor)
Log
Declaration
Tensor Log(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
LogicalAnd(Tensor, Tensor)
And
Declaration
Tensor LogicalAnd(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
LogicalNot(Tensor)
Not
Declaration
Tensor LogicalNot(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with !x values |
LogicalOr(Tensor, Tensor)
Or
Declaration
Tensor LogicalOr(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
LogicalXor(Tensor, Tensor)
Xor
Declaration
Tensor LogicalXor(Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | a | left Tensor |
| Tensor | b | right Tensor |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with |
LogSoftmax(Tensor, Int32)
LogSoftmax
Declaration
Tensor LogSoftmax(Tensor x, int axis = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
LRN(Tensor, Single, Single, Single, Int32)
LRN (Local Response Normalization)
Declaration
Tensor LRN(Tensor x, float alpha, float beta, float bias, int size)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
| Single | beta | beta |
| Single | bias | bias |
| Int32 | size | size |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
LSTM(Tensor, Tensor[], Tensor[], Tensor[], Tensor[], Tensor, Tensor)
LSTM
Declaration
Tensor[] LSTM(Tensor X, Tensor[] W, Tensor[] R, Tensor[] Wb, Tensor[] Rb, Tensor hidden, Tensor cell)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | X | The input sequences packed into one 3-D tensor. |
| Tensor[] | W | W parameter weight matrix for input, output, forget, and cell gates - W[iofc] |
| Tensor[] | R | R recurrence weight matrix for input, output, forget, and cell gates - R[iofc] |
| Tensor[] | Wb | W bias vectors for input, output, forget, and cell gates - Wb[iofc] |
| Tensor[] | Rb | R bias vectors for input, output, forget, and cell gates - Rb[iofc] |
| Tensor | hidden | Initial value of the hidden |
| Tensor | cell | Initial value of the cell |
Returns
| Type | Description |
|---|---|
| Tensor[] | [Y (concatenated intermediate values of the hidden), Y_h (final hidden), Y_c (final cell)] |
MatMul(Tensor, Boolean, Tensor, Boolean)
Matrix multiplication o = x ⨯ y
Declaration
Tensor MatMul(Tensor x, bool xTranspose, Tensor y, bool yTranspose)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | left Tensor |
| Boolean | xTranspose | transposed |
| Tensor | y | right Tensor |
| Boolean | yTranspose | transposed |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
MatMul(Tensor, Int32, Tensor, Int32)
Multidimensional Matrix multiplication o = x ⨯ y
Declaration
Tensor MatMul(Tensor x, int rankX, Tensor y, int rankY)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | left Tensor |
| Int32 | rankX | rank of |
| Tensor | y | right Tensor |
| Int32 | rankY | rank of |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Max(Tensor[])
Max
Declaration
Tensor Max(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
MaxPool2D(Tensor, Int32[], Int32[], Int32[])
2D max pooling
Declaration
Tensor MaxPool2D(Tensor x, int[] pool, int[] stride, int[] pad)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pool | pooling |
| Int32[] | stride | stride |
| Int32[] | pad | padding |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Mean(Tensor[])
Mean
Declaration
Tensor Mean(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Min(Tensor[])
Min
Declaration
Tensor Min(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Mul(Tensor[])
Multiply tensors together
Declaration
Tensor Mul(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Multinomial(Tensor, Int32, Int32)
Multinomial random distribution
Declaration
Tensor Multinomial(Tensor x, int count, int seed)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | count | count |
| Int32 | seed | seed |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Neg(Tensor)
Neg
Declaration
Tensor Neg(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
NonMaxSuppression(Tensor[], Int32, Single, Single, Int32)
Non max suppression tensors[0] - boxes, tensors[1] - scores
Declaration
Tensor NonMaxSuppression(Tensor[] tensors, int maxOutputBoxesPerClass, float iouThreshold, float scoreThreshold, int centerPointBox)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | |
| Int32 | maxOutputBoxesPerClass | max output boxes per class |
| Single | iouThreshold | IOU (Intersection Over Union) threshold |
| Single | scoreThreshold | score threshold |
| Int32 | centerPointBox | center point box |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
NonZero(Tensor)
Indices for non zero values
Declaration
Tensor NonZero(Tensor X)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | X | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Normalization(Tensor, Tensor, Tensor, Int32, Int32, Single, Layer.FusedActivation)
Normalization
Declaration
Tensor Normalization(Tensor x, Tensor s, Tensor b, int pool, int axis, float epsilon, Layer.FusedActivation fusedActivation)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | s | scale |
| Tensor | b | bias |
| Int32 | pool | pooling |
| Int32 | axis | axis |
| Single | epsilon | threshold |
| Layer.FusedActivation | fusedActivation | fused activation type |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
OneHot(Tensor, Int32, Single, Single, Int32)
One hot
Declaration
Tensor OneHot(Tensor x, int depth, float onValue, float offValue, int inputRank = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | depth | output depth |
| Single | onValue | on value |
| Single | offValue | off value |
| Int32 | inputRank | input rank helper |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Pad2DEdge(Tensor, Int32[])
Edge padding
Declaration
Tensor Pad2DEdge(Tensor x, int[] pad)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pad | padding |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Pad2DReflect(Tensor, Int32[])
Reflection padding
Declaration
Tensor Pad2DReflect(Tensor x, int[] pad)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pad | padding |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Pad2DSymmetric(Tensor, Int32[])
Symmetric padding
Declaration
Tensor Pad2DSymmetric(Tensor x, int[] pad)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | pad | padding |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
PostLayerCleanup()
Called after every layer execution. It allows IOps to run cleanup operations such as clearing temporary buffers only used in the scope of the last layer executed.
Declaration
void PostLayerCleanup()
Pow(Tensor, Single)
Power
Declaration
Tensor Pow(Tensor x, float alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Pow(Tensor[])
Raise tensors to the power o =tensors[0] ^ tensors[1] ^ ... ^ tensors[N-1]
Declaration
Tensor Pow(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
PRelu(Tensor, Tensor)
PReLU
Declaration
Tensor PRelu(Tensor x, Tensor alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | alpha | alpha |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Prepare(Tensor)
Prepares tensor for use
Declaration
Tensor Prepare(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor |
PrepareNoAlloc(Tensor)
Prepares tensor for use without uploading internal data to device
Declaration
Tensor PrepareNoAlloc(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor |
RandomNormal(TensorShape, Single, Single, Int32)
Normal random distribution
Declaration
Tensor RandomNormal(TensorShape s, float mean, float scale, int seed)
Parameters
| Type | Name | Description |
|---|---|---|
| TensorShape | s | shape |
| Single | mean | mean |
| Single | scale | scale |
| Int32 | seed | seed |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
RandomUniform(TensorShape, Single, Single, Int32)
Uniform random distribution
Declaration
Tensor RandomUniform(TensorShape s, float mean, float scale, int seed)
Parameters
| Type | Name | Description |
|---|---|---|
| TensorShape | s | shape |
| Single | mean | mean |
| Single | scale | scale |
| Int32 | seed | seed |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Reciprocal(Tensor)
Reciprocal (1/x)
Declaration
Tensor Reciprocal(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ReduceMax(Tensor, Int32)
Reduce with max
Declaration
Tensor ReduceMax(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ReduceMean(Tensor, Int32)
Reduce with mean
Declaration
Tensor ReduceMean(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ReduceMin(Tensor, Int32)
Reduce with min
Declaration
Tensor ReduceMin(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ReduceProd(Tensor, Int32)
Reduce with product
Declaration
Tensor ReduceProd(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ReduceSum(Tensor, Int32)
Reduce with sum
Declaration
Tensor ReduceSum(Tensor x, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Relu(Tensor)
ReLU
Declaration
Tensor Relu(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Relu6(Tensor)
ReLU capped to 6
Declaration
Tensor Relu6(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Resample2D(Tensor, Int32[], Boolean)
Resample 2D
Declaration
Tensor Resample2D(Tensor x, int[] size, bool bilinear)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | size | size |
| Boolean | bilinear | bilinear flag |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ResetAllocator(Boolean)
Reset internal allocator
Declaration
void ResetAllocator(bool keepCachedMemory = true)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | keepCachedMemory | keep cached memory flag |
Reshape(Tensor, TensorShape)
Reshape
Declaration
Tensor Reshape(Tensor x, TensorShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| TensorShape | shape | new shape |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
RoiAlign(Tensor, Tensor, Tensor, Int32, Int32, Int32, Single)
RoiAlign
Declaration
Tensor RoiAlign(Tensor x, Tensor rois, Tensor indices, int outputHeight, int outputWidth, int samplingRatio, float spatialScale)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | rois | |
| Tensor | indices | batch indices |
| Int32 | outputHeight | outputHeight |
| Int32 | outputWidth | outputWidth |
| Int32 | samplingRatio | samplingRatio |
| Single | spatialScale | spatialScale |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Round(Tensor)
Round to nearest integer. In case of halfs, round to nearest even integer
Declaration
Tensor Round(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ScaleBias(Tensor, Tensor, Tensor)
Scale bias o = s * x + b, element wise
Declaration
Tensor ScaleBias(Tensor x, Tensor s, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Tensor | s | scale |
| Tensor | b | bias |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
ScatterND(Tensor, Tensor, Tensor, Layer.ScatterNDReductionMode)
ScatterND
Declaration
Tensor ScatterND(Tensor x, Tensor indices, Tensor updates, Layer.ScatterNDReductionMode reduction)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | |
| Tensor | indices | indices |
| Tensor | updates | updates |
| Layer.ScatterNDReductionMode | reduction | reduction mode |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Selu(Tensor, Single, Single)
SELU
Declaration
Tensor Selu(Tensor x, float alpha, float gamma)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Single | alpha | alpha |
| Single | gamma | gamma |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
SetModelExecutionsReporter(IModelExecutionsReporter)
Set model executions reporter model executions reporter
Declaration
void SetModelExecutionsReporter(IModelExecutionsReporter executionsReporter)
Parameters
| Type | Name | Description |
|---|---|---|
| IModelExecutionsReporter | executionsReporter |
Shape(Tensor, Int32)
Shape of the input
Declaration
Tensor Shape(Tensor X, int axis = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | X | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Sigmoid(Tensor)
Sigmoid
Declaration
Tensor Sigmoid(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Sign(Tensor)
Sign
Declaration
Tensor Sign(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with 1 if x > 0 -1 if < 0 and 0 if == 0 values |
Sin(Tensor)
Sin
Declaration
Tensor Sin(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Sinh(Tensor)
Sinh
Declaration
Tensor Sinh(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Softmax(Tensor, Int32)
Softmax
Declaration
Tensor Softmax(Tensor x, int axis = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Softplus(Tensor)
Softplus
Declaration
Tensor Softplus(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
SpaceToDepth(Tensor, Int32[])
Space to depth
Declaration
Tensor SpaceToDepth(Tensor x, int[] scale)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | scale | scale |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Sqrt(Tensor)
Sqrt
Declaration
Tensor Sqrt(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
StridedSlice(Tensor, Int32[], Int32[], Int32[])
Strided slice
Declaration
Tensor StridedSlice(Tensor x, int[] starts4Dor8D, int[] ends4Dor8D, int[] strides4Dor8D)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | starts4Dor8D | |
| Int32[] | ends4Dor8D | |
| Int32[] | strides4Dor8D | stride |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Sub(Tensor[])
Subtract tensors o = tensors[0] - tensors[1] - ... - tensors[N-1]
Declaration
Tensor Sub(Tensor[] tensors)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor[] | tensors | input tensors |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Swish(Tensor)
Swish
Declaration
Tensor Swish(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Tan(Tensor)
Tan
Declaration
Tensor Tan(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Tanh(Tensor)
Tanh
Declaration
Tensor Tanh(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Tile(Tensor, Int32[])
Tile
Declaration
Tensor Tile(Tensor x, int[] repeats)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | repeats | repetition counts |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
TopKIndices(Tensor, Int32, Int32, Boolean, Boolean)
Top K indices
Declaration
Tensor TopKIndices(Tensor x, int k, int axis, bool largest, bool sorted)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32 | k | k |
| Int32 | axis | axis |
| Boolean | largest | largest flag |
| Boolean | sorted | sorted flag |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
TopKValues(Tensor, Tensor, Int32)
Top K values
Declaration
Tensor TopKValues(Tensor X, Tensor I, int axis)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | X | input |
| Tensor | I | indices |
| Int32 | axis | axis |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Transpose(Tensor)
Transpose matrix
Declaration
Tensor Transpose(Tensor x)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Transpose(Tensor, Int32[])
Transpose according to permutations
Declaration
Tensor Transpose(Tensor x, int[] permutations)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | permutations | new axis order |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Upsample2D(Tensor, Int32[], Boolean)
Upsample 2D
Declaration
Tensor Upsample2D(Tensor x, int[] scale, bool bilinear)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | scale | scale |
| Boolean | bilinear | bilinear flag |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Upsample3D(Tensor, Int32[], Boolean)
Upsample 3D
Declaration
Tensor Upsample3D(Tensor x, int[] scale, bool trilinear)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | x | input |
| Int32[] | scale | scale |
| Boolean | trilinear | trilinear flag |
Returns
| Type | Description |
|---|---|
| Tensor | output Tensor |
Where(Tensor, Tensor, Tensor)
Where
Declaration
Tensor Where(Tensor c, Tensor a, Tensor b)
Parameters
| Type | Name | Description |
|---|---|---|
| Tensor | c | Tensor c |
| Tensor | a | Tensor a |
| Tensor | b | Tensor b |
Returns
| Type | Description |
|---|---|
| Tensor | Tensor with values |