Class BurstCPUOps
Burst specific implementation of IOps
Inherited Members
Namespace: Unity.Barracuda
Syntax
public class BurstCPUOps : UnsafeArrayCPUOps, IOps
Constructors
BurstCPUOps(ITensorAllocator)
Create BurstCPUOps
Declaration
public BurstCPUOps(ITensorAllocator allocator = null)
Parameters
Type | Name | Description |
---|---|---|
ITensorAllocator | allocator | allocator |
Methods
Abs(Tensor)
Abs
Declaration
public override Tensor Abs(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Acos(Tensor)
Acos
Declaration
public override Tensor Acos(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Acosh(Tensor)
Acosh
Declaration
public override Tensor Acosh(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Add(Tensor[])
Add tensors
together
Declaration
public override Tensor Add(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Asin(Tensor)
Asin
Declaration
public override Tensor Asin(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Asinh(Tensor)
Asinh
Declaration
public override Tensor Asinh(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Atan(Tensor)
Atan
Declaration
public override Tensor Atan(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Atanh(Tensor)
Atanh
Declaration
public override Tensor Atanh(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
AvgPool2D(Tensor, Int32[], Int32[], Int32[])
2D average pooling
Declaration
public override Tensor AvgPool2D(Tensor X, int[] pool, int[] stride, int[] pad)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | pool | pooling |
Int32[] | stride | stride |
Int32[] | pad | padding |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Border2D(Tensor, Int32[], Single)
2D border padding
Declaration
public override Tensor Border2D(Tensor X, int[] pad, float constant)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | pad | padding |
Single | constant |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Ceil(Tensor)
Ceil
Declaration
public override Tensor Ceil(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Clip(Tensor, Single, Single)
Clip
Declaration
public override Tensor Clip(Tensor X, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Single | min | min value |
Single | max | max value |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Concat(Tensor[], Int32)
Concatenate tensors
across axis
Declaration
public override Tensor Concat(Tensor[] tensors, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Int32 | axis | axis |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Conv2D(Tensor, Tensor, Tensor, Int32[], Int32[], Layer.FusedActivation)
2D convolution
Declaration
public override Tensor Conv2D(Tensor X, Tensor K, Tensor B, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | K | |
Tensor | B | |
Int32[] | stride | stride |
Int32[] | pad | padding |
Layer.FusedActivation | fusedActivation | fused activation type |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
CopyAndReshape(Tensor, TensorShape)
Copy and reshape Tensor
Declaration
protected override Tensor CopyAndReshape(Tensor X, TensorShape shape)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | input |
TensorShape | shape | shape |
Returns
Type | Description |
---|---|
Tensor | output |
Overrides
Cos(Tensor)
Cos
Declaration
public override Tensor Cos(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Cosh(Tensor)
Cosh
Declaration
public override Tensor Cosh(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Dense(Tensor, Tensor, Tensor, Layer.FusedActivation)
Dense layer (matrix multiplication) o = x
⨯ w
+ b
Declaration
public override Tensor Dense(Tensor X, Tensor W, Tensor B, Layer.FusedActivation fusedActivation)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | W | |
Tensor | B | |
Layer.FusedActivation | fusedActivation | fused activation type |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
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
public override Tensor Dense3(Tensor X, Tensor W, Tensor B)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | W | |
Tensor | B |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
DepthwiseConv2D(Tensor, Tensor, Tensor, Int32[], Int32[], Layer.FusedActivation)
Depthwise 2D convolution
Declaration
public override Tensor DepthwiseConv2D(Tensor X, Tensor K, Tensor B, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | K | |
Tensor | B | |
Int32[] | stride | stride |
Int32[] | pad | padding |
Layer.FusedActivation | fusedActivation | fused activation type |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Div(Tensor[])
Divide tensors o = tensors[0] / tensors[1] / ... / tensors[N-1]
Declaration
public override Tensor Div(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Elu(Tensor, Single)
ELU
Declaration
public override Tensor Elu(Tensor X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Single | alpha | alpha |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Exp(Tensor)
Exponent e^x
Declaration
public override Tensor Exp(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Floor(Tensor)
Floor
Declaration
public override Tensor Floor(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Gather(Tensor[], Int32)
Gather
Declaration
public override Tensor Gather(Tensor[] tensors, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Int32 | axis | axis |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
GlobalAvgPool2D(Tensor)
2D global average pooling
Declaration
public override Tensor GlobalAvgPool2D(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
GlobalMaxPool2D(Tensor)
2D global max pooling
Declaration
public override Tensor GlobalMaxPool2D(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
LeakyRelu(Tensor, Single)
Leaky ReLU
Declaration
public override Tensor LeakyRelu(Tensor X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Single | alpha | alpha |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Log(Tensor)
Log
Declaration
public override Tensor Log(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
LogSoftmax(Tensor)
LogSoftmax
Declaration
public override Tensor LogSoftmax(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
LSTM(Tensor, Tensor[], Tensor[], Tensor[], Tensor[], Tensor, Tensor)
Declaration
public override Tensor[] LSTM(Tensor X, Tensor[] W, Tensor[] R, Tensor[] Wb, Tensor[] Rb, Tensor hidden, Tensor cell)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor[] | W | |
Tensor[] | R | |
Tensor[] | Wb | |
Tensor[] | Rb | |
Tensor | hidden | |
Tensor | cell |
Returns
Type | Description |
---|---|
Tensor[] |
Overrides
MatMul(Tensor, Boolean, Tensor, Boolean)
Simple 2D matrix multiplication O = X
⨯ Y
Declaration
public override Tensor MatMul(Tensor X, bool xTranspose, Tensor Y, bool yTranspose)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | left Tensor |
Boolean | xTranspose |
|
Tensor | Y | right Tensor |
Boolean | yTranspose |
|
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
MatMul(Tensor, Int32, Tensor, Int32)
Multidimensional Matrix multiplication o = x
⨯ y
Declaration
public override Tensor MatMul(Tensor X, int rankX, Tensor Y, int rankY)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32 | rankX | rank of |
Tensor | Y | |
Int32 | rankY | rank of |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Max(Tensor[])
Max
Declaration
public override Tensor Max(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
MaxPool2D(Tensor, Int32[], Int32[], Int32[])
2D max pooling
Declaration
public override Tensor MaxPool2D(Tensor X, int[] pool, int[] stride, int[] pad)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | pool | pooling |
Int32[] | stride | stride |
Int32[] | pad | padding |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Min(Tensor[])
Min
Declaration
public override Tensor Min(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Mul(Tensor[])
Multiply tensors together
Declaration
public override Tensor Mul(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Neg(Tensor)
Neg
Declaration
public override Tensor Neg(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
OneHot(Tensor, Int32, Single, Single)
One hot
Declaration
public override Tensor OneHot(Tensor X, int depth, float onValue, float offValue)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32 | depth | output depth |
Single | onValue | on value |
Single | offValue | off value |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Pin(Tensor, Boolean)
Pin Tensor
to Burst backend device, if uploadCache
is false, data is not uploaded to device
Declaration
public static BurstTensorData Pin(Tensor X, bool uploadCache = true)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
|
Boolean | uploadCache |
|
Returns
Type | Description |
---|---|
BurstTensorData |
|
Pow(Tensor, Single)
Power
Declaration
public override Tensor Pow(Tensor X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Single | alpha | alpha |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Pow(Tensor[])
Raise tensors to the power o =tensors[0] ^ tensors[1] ^ ... ^ tensors[N-1]
Declaration
public override Tensor Pow(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
PRelu(Tensor, Tensor)
PReLU
Declaration
public override Tensor PRelu(Tensor X, Tensor S)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | S |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Prepare(Tensor)
Prepare Tensor
for use with Burst backend
Declaration
public override Tensor Prepare(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
|
Returns
Type | Description |
---|---|
Tensor |
|
Overrides
PrepareNoAlloc(Tensor)
Declaration
public override Tensor PrepareNoAlloc(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor |
Overrides
Reciprocal(Tensor)
Reciprocal (1/x)
Declaration
public override Tensor Reciprocal(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
ReduceMax(Tensor, Int32)
Declaration
public override Tensor ReduceMax(Tensor X, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32 | axis |
Returns
Type | Description |
---|---|
Tensor |
Overrides
ReduceMean(Tensor, Int32)
Reduce with mean
Declaration
public override Tensor ReduceMean(Tensor X, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32 | axis | axis |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
ReduceSum(Tensor, Int32)
Reduce with sum
Declaration
public override Tensor ReduceSum(Tensor X, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32 | axis | axis |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Relu(Tensor)
ReLU
Declaration
public override Tensor Relu(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Relu6(Tensor)
ReLU capped to 6
Declaration
public override Tensor Relu6(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Round(Tensor)
Round to nearest integer. In case of halfs, round to nearest even integer
Declaration
public override Tensor Round(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
ScaleBias(Tensor, Tensor, Tensor)
Scale bias o = s * x + b, element wise
Declaration
public override Tensor ScaleBias(Tensor X, Tensor S, Tensor B)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | S | |
Tensor | B |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Selu(Tensor, Single, Single)
SELU
Declaration
public override Tensor Selu(Tensor X, float alpha, float gamma)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Single | alpha | alpha |
Single | gamma | gamma |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Sigmoid(Tensor)
Sigmoid
Declaration
public override Tensor Sigmoid(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Sin(Tensor)
Sin
Declaration
public override Tensor Sin(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Sinh(Tensor)
Sinh
Declaration
public override Tensor Sinh(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Softmax(Tensor, Int32)
Softmax
Declaration
public override Tensor Softmax(Tensor X, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32 | axis | axis |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Softplus(Tensor)
Softplus
Declaration
public override Tensor Softplus(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Sqrt(Tensor)
Sqrt
Declaration
public override Tensor Sqrt(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
StridedSlice(Tensor, Int32[], Int32[], Int32[])
Strided slice
Declaration
public override Tensor StridedSlice(Tensor X, int[] starts4Dor8D, int[] ends4Dor8D, int[] strides4Dor8D)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | starts4Dor8D | |
Int32[] | ends4Dor8D | |
Int32[] | strides4Dor8D | stride |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Sub(Tensor[])
Subtract tensors o = tensors[0] - tensors[1] - ... - tensors[N-1]
Declaration
public override Tensor Sub(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | input tensors |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Swish(Tensor)
Swish
Declaration
public override Tensor Swish(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Tan(Tensor)
Tan
Declaration
public override Tensor Tan(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Tanh(Tensor)
Tanh
Declaration
public override Tensor Tanh(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Tile(Tensor, Int32[])
Tile
Declaration
public override Tensor Tile(Tensor X, int[] repeats)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | repeats | repetition counts |
Returns
Type | Description |
---|---|
Tensor | output Tensor |
Overrides
Transpose(Tensor, Int32[])
Transpose according to permutations
Declaration
public override Tensor Transpose(Tensor X, int[] permutations)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | permutations | new axis order |
Returns
Type | Description |
---|---|
Tensor | output Tensor |