Class GPUCommandBufferOps
Reference GPU compute IOps
implementation
Inherited Members
Namespace: Unity.Sentis
Syntax
public class GPUCommandBufferOps : CPUOps, IOps, IDisposable
Constructors
GPUCommandBufferOps(ITensorAllocator)
Create GPUCommandBufferOps
Declaration
public GPUCommandBufferOps(ITensorAllocator allocator = null)
Parameters
Type | Name | Description |
---|---|---|
ITensorAllocator | allocator | allocator |
GPUCommandBufferOps(CommandBuffer, ITensorAllocator)
Create GPUCommandBufferOps
Declaration
public GPUCommandBufferOps(CommandBuffer cb, ITensorAllocator allocator = null)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cb | commandbuffer |
ITensorAllocator | allocator | allocator |
Fields
cb
Declaration
public CommandBuffer cb
Field Value
Type | Description |
---|---|
CommandBuffer |
Properties
deviceType
Returns the DeviceType
for the ops.
Declaration
public override DeviceType deviceType { get; }
Property Value
Type | Description |
---|---|
DeviceType |
Overrides
Methods
Abs(TensorFloat)
Computes an output tensor by applying the element-wise Abs
math function: f(x) = f(x) = |x|.
Declaration
public override TensorFloat Abs(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Abs(TensorInt)
Computes an output tensor by applying the element-wise Abs
math function: f(x) = f(x) = |x|.
Declaration
public override TensorInt Abs(TensorInt X)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Acos(TensorFloat)
Computes an output tensor by applying the element-wise Acos
trigonometric function: f(x) = acos(x).
Declaration
public override TensorFloat Acos(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Acosh(TensorFloat)
Computes an output tensor by applying the element-wise Acosh
trigonometric function: f(x) = acosh(x).
Declaration
public override TensorFloat Acosh(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Add(TensorFloat, TensorFloat)
Performs an element-wise Add
math operation: f(a, b) = a + b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Add(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Add(TensorInt, TensorInt)
Performs an element-wise Add
math operation: f(a, b) = a + b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Add(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
And(TensorInt, TensorInt)
Declaration
public override TensorInt And(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | |
TensorInt | B |
Returns
Type | Description |
---|---|
TensorInt |
Overrides
ArgMax(TensorFloat, Int32, Boolean, Boolean)
Computes the indices of the maximum elements of the input tensor along a given axis.
Declaration
public override TensorInt ArgMax(TensorFloat X, int axis, bool keepdim, bool selectLastIndex = false)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | axis | The axis along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Boolean | selectLastIndex | Whether to perform the operation from the back of the axis. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ArgMax(TensorInt, Int32, Boolean, Boolean)
Computes the indices of the maximum elements of the input tensor along a given axis.
Declaration
public override TensorInt ArgMax(TensorInt X, int axis, bool keepdim, bool selectLastIndex = false)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32 | axis | The axis along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Boolean | selectLastIndex | Whether to perform the operation from the back of the axis. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ArgMin(TensorFloat, Int32, Boolean, Boolean)
Computes the indices of the minimum elements of the input tensor along a given axis.
Declaration
public override TensorInt ArgMin(TensorFloat X, int axis, bool keepdim, bool selectLastIndex = false)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | axis | The axis along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Boolean | selectLastIndex | Whether to perform the operation from the back of the axis. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ArgMin(TensorInt, Int32, Boolean, Boolean)
Computes the indices of the minimum elements of the input tensor along a given axis.
Declaration
public override TensorInt ArgMin(TensorInt X, int axis, bool keepdim, bool selectLastIndex = false)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32 | axis | The axis along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Boolean | selectLastIndex | Whether to perform the operation from the back of the axis. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Asin(TensorFloat)
Computes an output tensor by applying the element-wise Asin
trigonometric function: f(x) = asin(x).
Declaration
public override TensorFloat Asin(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Asinh(TensorFloat)
Computes an output tensor by applying the element-wise Asinh
trigonometric function: f(x) = asinh(x).
Declaration
public override TensorFloat Asinh(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Atan(TensorFloat)
Computes an output tensor by applying the element-wise Atan
trigonometric function: f(x) = atan(x).
Declaration
public override TensorFloat Atan(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Atanh(TensorFloat)
Computes an output tensor by applying the element-wise Atanh
trigonometric function: f(x) = atanh(x).
Declaration
public override TensorFloat Atanh(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
AveragePool(TensorFloat, Int32[], Int32[], Int32[])
Calculates an output tensor by pooling the mean values of the input tensor across its spatial dimensions according to the given pool and stride values.
Declaration
public override TensorFloat AveragePool(TensorFloat X, int[] pool, int[] stride, int[] pad)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | pool | The size of the kernel along each spatial axis. |
Int32[] | stride | The stride along each spatial axis. |
Int32[] | pad | The lower and upper padding values for each spatial dimension. For example, [pad_left, pad_right] for 1D, or [pad_top, pad_bottom, pad_left, pad_right] for 2D. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
AxisNormalization(TensorFloat, TensorFloat, TensorFloat, Single)
Declaration
public override TensorFloat AxisNormalization(TensorFloat X, TensorFloat S, TensorFloat B, float epsilon)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
TensorFloat | S | |
TensorFloat | B | |
Single | epsilon |
Returns
Type | Description |
---|---|
TensorFloat |
Overrides
Bernoulli(TensorFloat, DataType, Nullable<Single>)
Generates an output tensor with values 0 or 1 from a Bernoulli distribution. The input tensor contains the probabilities to use for generating the output values.
Declaration
public override Tensor Bernoulli(TensorFloat X, DataType dataType, float? seed)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
DataType | dataType | The data type of the output tensor. |
Nullable<Single> | seed | The optional seed to use for the random number generation. If this is |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Cast(Tensor, DataType)
Computes the output tensor using an element-wise Cast
function: f(x) = (float)x or f(x) = (int)x depending on the value of toType
.
Declaration
public override Tensor Cast(Tensor X, DataType toType)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
DataType | toType | The data type to cast to as a |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Ceil(TensorFloat)
Computes an output tensor by applying the element-wise Ceil
math function: f(x) = ceil(x).
Declaration
public override TensorFloat Ceil(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Celu(TensorFloat, Single)
Computes an output tensor by applying the element-wise Celu
activation function: f(x) = max(0, x) + min(0, alpha * (exp(x / alpha) - 1)).
Declaration
public override TensorFloat Celu(TensorFloat X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | alpha | The alpha value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Clip(TensorFloat, Single, Single)
Computes an output tensor by applying the element-wise Clip
math function: f(x) = clamp(x, min, max).
Declaration
public override TensorFloat Clip(TensorFloat X, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | min | The lower clip value. |
Single | max | The upper clip value. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
CompressWithIndices(Tensor, TensorInt, Int32, Int32)
Declaration
protected override Tensor CompressWithIndices(Tensor X, TensorInt indices, int numIndices, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
TensorInt | indices | |
Int32 | numIndices | |
Int32 | axis |
Returns
Type | Description |
---|---|
Tensor |
Overrides
Concat(Tensor[], Int32)
Calculates an output tensor by concatenating the input tensors along a given axis.
Declaration
public override Tensor Concat(Tensor[] tensors, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | The input tensors. |
Int32 | axis | The axis along which to concatenate the input tensors. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
ConstantOfShape(TensorShape, Int32)
Generates a tensor with a given shape filled with a given value.
Declaration
public override TensorInt ConstantOfShape(TensorShape X, int value)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | X | The input tensor shape. |
Int32 | value | The fill value. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ConstantOfShape(TensorShape, Single)
Generates a tensor with a given shape filled with a given value.
Declaration
public override TensorFloat ConstantOfShape(TensorShape X, float value)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | X | The input tensor shape. |
Single | value | The fill value. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Conv(TensorFloat, TensorFloat, TensorFloat, Int32, Int32[], Int32[], Int32[], FusableActivation)
Applies a convolution filter to an input tensor.
Declaration
public override TensorFloat Conv(TensorFloat X, TensorFloat K, TensorFloat B, int groups, int[] stride, int[] pad, int[] dilation, FusableActivation fusedActivation)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | K | The filter tensor. |
TensorFloat | B | The optional bias tensor. |
Int32 | groups | The number of groups that input channels and output channels are divided into. |
Int32[] | stride | The optional stride value for each spatial dimension of the filter. |
Int32[] | pad | The optional lower and upper padding values for each spatial dimension of the filter. |
Int32[] | dilation | The optional dilation value of each spatial dimension of the filter. |
FusableActivation | fusedActivation | The fused activation type to apply after the convolution. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Conv2DTrans(TensorFloat, TensorFloat, TensorFloat, Int32[], Int32[], Int32[], FusableActivation)
Applies a transpose convolution filter to an input tensor.
Declaration
public override TensorFloat Conv2DTrans(TensorFloat X, TensorFloat K, TensorFloat B, int[] stride, int[] pad, int[] outputAdjustment, FusableActivation fusedActivation)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | K | The filter tensor. |
TensorFloat | B | The optional bias tensor. |
Int32[] | stride | The optional stride value for each spatial dimension of the filter. |
Int32[] | pad | The optional lower and upper padding values for each spatial dimension of the filter. |
Int32[] | outputAdjustment | The output padding value for each spatial dimension in the filter. |
FusableActivation | fusedActivation | The fused activation type to apply after the convolution. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Cos(TensorFloat)
Computes an output tensor by applying the element-wise Cos
trigonometric function: f(x) = cos(x).
Declaration
public override TensorFloat Cos(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Cosh(TensorFloat)
Computes an output tensor by applying the element-wise Cosh
trigonometric function: f(x) = cosh(x).
Declaration
public override TensorFloat Cosh(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
CumSum(TensorFloat, Int32, Boolean, Boolean)
Performs the cumulative sum along a given axis.
Declaration
public override TensorFloat CumSum(TensorFloat X, int axis, bool reverse, bool exclusive)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | axis | The axis along which to apply the cumulative sum. |
Boolean | reverse | Whether to perform the cumulative sum from the end of the axis. |
Boolean | exclusive | Whether to include the respective input element in the cumulative sum. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
CumSum(TensorInt, Int32, Boolean, Boolean)
Performs the cumulative sum along a given axis.
Declaration
public override TensorInt CumSum(TensorInt X, int axis, bool reverse, bool exclusive)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32 | axis | The axis along which to apply the cumulative sum. |
Boolean | reverse | Whether to perform the cumulative sum from the end of the axis. |
Boolean | exclusive | Whether to include the respective input element in the cumulative sum. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Dense(TensorFloat, TensorFloat, TensorFloat, FusableActivation)
Performs a matrix multiplication operation: f(x, w, b) = X x W + B.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Dense(TensorFloat X, TensorFloat W, TensorFloat B, FusableActivation fusedActivation)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | W | The weights tensor. |
TensorFloat | B | The bias tensor. |
FusableActivation | fusedActivation | The fused activation to apply to the output tensor after the dense operation. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
DepthToSpace(TensorFloat, Int32, DepthToSpaceMode)
Computes the output tensor by permuting data from depth into blocks of spatial data.
Declaration
public override TensorFloat DepthToSpace(TensorFloat X, int blocksize, DepthToSpaceMode mode)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | blocksize | The size of the blocks to move the depth data into. |
DepthToSpaceMode | mode | The ordering of the data in the output tensor as a |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Div(TensorFloat, TensorFloat)
Performs an element-wise Div
math operation: f(a, b) = a / b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Div(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Div(TensorInt, TensorInt)
Performs an element-wise Div
math operation: f(a, b) = a / b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Div(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Einsum(String, TensorFloat[])
Performs an Einsum
math operation.
Declaration
public override TensorFloat Einsum(string equation, params TensorFloat[] operands)
Parameters
Type | Name | Description |
---|---|---|
String | equation | The equation of the Einstein summation as a comma-separated list of subscript labels. |
TensorFloat[] | operands | The input tensors of the Einsum. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Elu(TensorFloat, Single)
Computes an output tensor by applying the element-wise Elu
activation function: f(x) = x if x >= 0, otherwise f(x) = alpha * (e^x - 1).
Declaration
public override TensorFloat Elu(TensorFloat X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Single | alpha | The alpha value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Equal(TensorFloat, TensorFloat)
Performs an element-wise Equal
logical comparison operation: f(a, b) = 1 if a == b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Equal(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Equal(TensorInt, TensorInt)
Performs an element-wise Equal
logical comparison operation: f(a, b) = 1 if a == b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Equal(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Erf(TensorFloat)
Computes an output tensor by applying the element-wise Erf
activation function: f(x) = erf(x).
Declaration
public override TensorFloat Erf(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Exp(TensorFloat)
Computes an output tensor by applying the element-wise Exp
math function: f(x) = exp(x).
Declaration
public override TensorFloat Exp(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Expand(Tensor, TensorShape)
Calculates an output tensor by broadcasting the input tensor into a given shape.
Declaration
public override Tensor Expand(Tensor X, TensorShape newShape)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
TensorShape | newShape |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Floor(TensorFloat)
Computes an output tensor by applying the element-wise Floor
math function: f(x) = floor(x).
Declaration
public override TensorFloat Floor(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
FMod(TensorFloat, TensorFloat)
Performs an element-wise Mod
math operation: f(a, b) = a % b.
The sign of the remainder is the same as the sign of the dividend, as in C#.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat FMod(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
FMod(TensorInt, TensorInt)
Performs an element-wise Mod
math operation: f(a, b) = a % b.
The sign of the remainder is the same as the sign of the dividend, as in C#.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt FMod(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Gather(Tensor, TensorInt, Int32)
Takes values from the input tensor indexed by the indices tensor along a given axis and concatenates them.
Declaration
public override Tensor Gather(Tensor X, TensorInt indices, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
TensorInt | indices | The indices tensor. |
Int32 | axis | The axis along which to gather. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
GatherElements(Tensor, TensorInt, Int32)
Takes values from the input tensor indexed by the indices tensor along a given axis and concatenates them.
Declaration
public override Tensor GatherElements(Tensor X, TensorInt indices, int axis)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
TensorInt | indices | The indices tensor. |
Int32 | axis | The axis along which to gather. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
GatherND(Tensor, TensorInt, Int32)
Takes slices of values from the batched input tensor indexed by the indices
tensor.
Declaration
public override Tensor GatherND(Tensor X, TensorInt indices, int batchDims)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
TensorInt | indices | The indices tensor. |
Int32 | batchDims | The number of batch dimensions of the input tensor, the gather begins at the next dimension. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Gelu(TensorFloat)
Computes an output tensor by applying the element-wise Gelu
activation function: f(x) = x / 2 * (1 + erf(x / sqrt(2))).
Declaration
public override TensorFloat Gelu(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
GlobalAveragePool(TensorFloat)
Calculates an output tensor by pooling the mean values of the input tensor across all of its spatial dimensions. The spatial dimensions of the output are size 1.
Declaration
public override TensorFloat GlobalAveragePool(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
GlobalAverageVariancePool(TensorFloat, TensorFloat, Int32)
Declaration
public override void GlobalAverageVariancePool(TensorFloat O, TensorFloat X, int axis)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | O | |
TensorFloat | X | |
Int32 | axis |
Overrides
GlobalMaxPool(TensorFloat)
Calculates an output tensor by pooling the maximum values of the input tensor across all of its spatial dimensions. The spatial dimensions of the output are size 1.
Declaration
public override TensorFloat GlobalMaxPool(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Greater(TensorFloat, TensorFloat)
Performs an element-wise Greater
logical comparison operation: f(a, b) = 1 if a > b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Greater(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Greater(TensorInt, TensorInt)
Performs an element-wise Greater
logical comparison operation: f(a, b) = 1 if a > b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Greater(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
GreaterOrEqual(TensorFloat, TensorFloat)
Performs an element-wise GreaterOrEqual
logical comparison operation: f(a, b) = 1 if a >= b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt GreaterOrEqual(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
GreaterOrEqual(TensorInt, TensorInt)
Performs an element-wise GreaterOrEqual
logical comparison operation: f(a, b) = 1 if a >= b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt GreaterOrEqual(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Hardmax(TensorFloat, Int32)
Computes an output tensor by applying the Hardmax
activation function along an axis: f(x, axis) = 1 if x is the first maximum value along the specified axis, otherwise f(x) = 0.
Declaration
public override TensorFloat Hardmax(TensorFloat X, int axis)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | axis | The axis along which to apply the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
HardSigmoid(TensorFloat, Single, Single)
Computes an output tensor by applying the element-wise HardSigmoid
activation function: f(x) = clamp(alpha * x + beta, 0, 1).
Declaration
public override TensorFloat HardSigmoid(TensorFloat X, float alpha, float beta)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | alpha | The alpha value to use for the |
Single | beta | The beta value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
HardSwish(TensorFloat)
Computes an output tensor by applying the element-wise HardSwish
activation function: f(x) = x * max(0, min(1, 1/6 * x + 0.5)).
Declaration
public override TensorFloat HardSwish(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
InstanceNormalization(TensorFloat, TensorFloat, TensorFloat, Single)
Computes the mean variance on the spatial dimensions of the input tensor and normalizes them according to scale
and bias
tensors.
Declaration
public override TensorFloat InstanceNormalization(TensorFloat X, TensorFloat S, TensorFloat B, float epsilon)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | S | The scale tensor. |
TensorFloat | B | The bias tensor. |
Single | epsilon | The epsilon value the layer uses to avoid division by zero. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
IsInf(TensorFloat, Boolean, Boolean)
Performs an element-wise IsInf
logical operation: f(x) = 1 elementwise if x is +Inf and detectPositive
is true
, or x is -Inf and detectNegative
is true
. Otherwise f(x) = 0.
Declaration
public override TensorInt IsInf(TensorFloat X, bool detectNegative, bool detectPositive)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Boolean | detectNegative | Whether to detect negative infinities in the |
Boolean | detectPositive | Whether to detect positive infinities in the |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
IsNaN(TensorFloat)
Performs an element-wise IsNaN
logical operation: f(x) = 1 if x is NaN, otherwise f(x) = 0.
Declaration
public override TensorInt IsNaN(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
LeakyRelu(TensorFloat, Single)
Computes an output tensor by applying the element-wise LeakyRelu
activation function: f(x) = x if x >= 0, otherwise f(x) = alpha * x.
Declaration
public override TensorFloat LeakyRelu(TensorFloat X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | alpha | The alpha value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Less(TensorFloat, TensorFloat)
Performs an element-wise Less
logical comparison operation: f(a, b) = 1 if a < b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Less(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Less(TensorInt, TensorInt)
Performs an element-wise Less
logical comparison operation: f(a, b) = 1 if a < b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Less(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
LessOrEqual(TensorFloat, TensorFloat)
Performs an element-wise LessOrEqual
logical comparison operation: f(a, b) = 1 if a <= b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt LessOrEqual(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
LessOrEqual(TensorInt, TensorInt)
Performs an element-wise LessOrEqual
logical comparison operation: f(a, b) = 1 if a <= b, otherwise f(x) = 0.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt LessOrEqual(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Log(TensorFloat)
Computes an output tensor by applying the element-wise Log
math function: f(x) = log(x).
Declaration
public override TensorFloat Log(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
LogSoftmax(TensorFloat, Int32)
Computes an output tensor by applying the LogSoftmax
activation function along an axis: f(x, axis) = log(Softmax(x, axis)).
Declaration
public override TensorFloat LogSoftmax(TensorFloat X, int axis)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | axis | The axis along which to apply the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
MatMul(TensorFloat, TensorFloat)
Performs a multi-dimensional matrix multiplication operation: f(a, b) = a x b.
Declaration
public override TensorFloat MatMul(TensorFloat X, TensorFloat Y)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The first input tensor. |
TensorFloat | Y | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
MatMul2D(TensorFloat, Boolean, TensorFloat, Boolean)
Performs a matrix multiplication operation with optional transposes: f(a, b) = a' x b'.
Declaration
public override TensorFloat MatMul2D(TensorFloat X, bool xTranspose, TensorFloat Y, bool yTranspose)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The first input tensor. |
Boolean | xTranspose | Whether to transpose the first input tensor before performing the matrix multiplication. |
TensorFloat | Y | |
Boolean | yTranspose | Whether to transpose the second input tensor before performing the matrix multiplication. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Max(TensorFloat[])
Performs an element-wise Max
math operation: f(x1, x2 ... xn) = max(x1, x2 ... xn).
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Max(TensorFloat[] tensors)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat[] | tensors | The input tensors. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Max(TensorInt[])
Performs an element-wise Max
math operation: f(x1, x2 ... xn) = max(x1, x2 ... xn).
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Max(TensorInt[] tensors)
Parameters
Type | Name | Description |
---|---|---|
TensorInt[] | tensors | The input tensors. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
MaxPool(TensorFloat, Int32[], Int32[], Int32[])
Calculates an output tensor by pooling the maximum values of the input tensor across its spatial dimensions according to the given pool and stride values.
Declaration
public override TensorFloat MaxPool(TensorFloat X, int[] pool, int[] stride, int[] pad)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | pool | The size of the kernel along each spatial axis. |
Int32[] | stride | The stride along each spatial axis. |
Int32[] | pad | The lower and upper padding values for each spatial dimension. For example, [pad_left, pad_right] for 1D, or [pad_top, pad_bottom, pad_left, pad_right] for 2D. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Mean(TensorFloat[])
Performs an element-wise Mean
math operation: f(x1, x2 ... xn) = (x1 + x2 ... xn) / n.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Mean(TensorFloat[] tensors)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat[] | tensors | The input tensors. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
MemCopy(Tensor, Tensor, Int32, Int32, Int32)
Copy blocks of values from X to O, we copy 'count' blocks each of length 'length' values with initial offsets given by 'offsetX', 'offsetO' and with strides given by 'strideX', 'strideO'
Declaration
protected override void MemCopy(Tensor X, Tensor O, int length = -1, int offsetX = 0, int offsetO = 0)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | O | |
Int32 | length | |
Int32 | offsetX | |
Int32 | offsetO |
Overrides
MemCopyStride(Tensor, Tensor, Int32, Int32, Int32, Int32, Int32, Int32)
Copy blocks of values from X to O, we copy 'count' blocks each of length 'length' values with initial offsets given by 'offsetX', 'offsetO' and with strides given by 'strideX', 'strideO'
Declaration
protected override void MemCopyStride(Tensor X, Tensor O, int strideX, int strideO, int length, int count, int offsetX = 0, int offsetO = 0)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Tensor | O | |
Int32 | strideX | |
Int32 | strideO | |
Int32 | length | |
Int32 | count | |
Int32 | offsetX | |
Int32 | offsetO |
Overrides
MemSet(Tensor, Int32, Int32, Int32)
Set values of O in indices [offset0, offsetO + length] to value
Declaration
protected override void MemSet(Tensor O, int value, int length = -1, int offsetO = 0)
Parameters
Type | Name | Description |
---|---|---|
Tensor | O | |
Int32 | value | |
Int32 | length | |
Int32 | offsetO |
Overrides
Min(TensorFloat[])
Performs an element-wise Min
math operation: f(x1, x2 ... xn) = min(x1, x2 ... xn).
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Min(TensorFloat[] tensors)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat[] | tensors | The input tensors. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Min(TensorInt[])
Performs an element-wise Min
math operation: f(x1, x2 ... xn) = min(x1, x2 ... xn).
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Min(TensorInt[] tensors)
Parameters
Type | Name | Description |
---|---|---|
TensorInt[] | tensors | The input tensors. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Mod(TensorInt, TensorInt)
Performs an element-wise Mod
math operation: f(a, b) = a % b.
The sign of the remainder is the same as the sign of the divisor, as in Python.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Mod(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Mul(TensorFloat, TensorFloat)
Performs an element-wise Mul
math operation: f(a, b) = a * b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Mul(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Mul(TensorInt, TensorInt)
Performs an element-wise Mul
math operation: f(a, b) = a * b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Mul(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Neg(TensorFloat)
Computes an output tensor by applying the element-wise Neg
math function: f(x) = -x.
Declaration
public override TensorFloat Neg(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Neg(TensorInt)
Computes an output tensor by applying the element-wise Neg
math function: f(x) = -x.
Declaration
public override TensorInt Neg(TensorInt X)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
NewTensor(TensorShape, DataType, AllocScope)
Allocates a new tensor with the internal allocator.
Declaration
public override Tensor NewTensor(TensorShape shape, DataType dataType, AllocScope scope)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | shape | |
DataType | dataType | |
AllocScope | scope |
Returns
Type | Description |
---|---|
Tensor |
Overrides
Not(TensorInt)
Performs an element-wise Not
logical operation: f(x) = ~x.
Declaration
public override TensorInt Not(TensorInt X)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
OneHot(TensorInt, Int32, Int32, Int32, Int32)
Generates a one-hot tensor with a given depth
, indices
and on and off values.
Declaration
public override TensorInt OneHot(TensorInt X, int axis, int depth, int offValue, int onValue)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | |
Int32 | axis | The axis along which the operation adds the one-hot representation. |
Int32 | depth | The depth of the one-hot tensor. |
Int32 | offValue | The value to use for an off element. |
Int32 | onValue | The value to use for an on element. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Or(TensorInt, TensorInt)
Performs an element-wise Or
logical operation: f(a, b) = a | b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Or(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Pad(TensorFloat, Int32[], PadMode, Single)
Calculates the output tensor by adding padding to the input tensor according to the given padding values and mode.
Declaration
public override TensorFloat Pad(TensorFloat X, int[] pad, PadMode padMode, float constant)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | pad | The lower and upper padding values for each dimension. |
PadMode | padMode | The |
Single | constant | The constant value to fill with when using |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
PinToDevice(Tensor, Boolean)
Prepares Tensor
for use with CPU backend.
Declaration
public override Tensor PinToDevice(Tensor X, bool uploadCache = true)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
|
Boolean | uploadCache | Whether to copy tensor data to CPU backend. |
Returns
Type | Description |
---|---|
Tensor |
|
Overrides
Pow(TensorFloat, TensorFloat)
Performs an element-wise Pow
math operation: f(a, b) = pow(a, b).
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Pow(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Pow(TensorFloat, TensorInt)
Performs an element-wise Pow
math operation: f(a, b) = pow(a, b).
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Pow(TensorFloat A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
PRelu(TensorFloat, TensorFloat)
Computes an output tensor by applying the element-wise PRelu
activation function: f(x) = x if x >= 0, otherwise f(x) = slope * x.
Declaration
public override TensorFloat PRelu(TensorFloat X, TensorFloat S)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
TensorFloat | S |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
RandomNormal(TensorShape, Single, Single, Nullable<Single>)
Generates an output tensor of a given shape with random values in a normal distribution with given mean
and scale
, and an optional seed
value.
Declaration
public override TensorFloat RandomNormal(TensorShape s, float mean, float scale, float? seed)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | s | |
Single | mean | The mean of the normal distribution to use to generate the output. |
Single | scale | The standard deviation of the normal distribution to use to generate the output. |
Nullable<Single> | seed | The optional seed to use for the random number generation. If this is |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
RandomUniform(TensorShape, Single, Single, Nullable<Single>)
Generates an output tensor of a given shape with random values in a uniform distribution between a given low
and high
, and an optional seed
value.
Declaration
public override TensorFloat RandomUniform(TensorShape s, float low, float high, float? seed)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | s | |
Single | low | The lower end of the interval of the uniform distribution to use to generate the output. |
Single | high | The upper end of the interval of the uniform distribution to use to generate the output. |
Nullable<Single> | seed | The optional seed to use for the random number generation. If this is |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Range(Int32, Int32, Int32)
Generates a 1D output tensor where the values form an arithmetic progression defined by the start
, limit
, and delta
values.
Declaration
public override TensorInt Range(int start, int limit, int delta)
Parameters
Type | Name | Description |
---|---|---|
Int32 | start | The first value in the range. |
Int32 | limit | The limit of the range. |
Int32 | delta | The delta between subsequent values in the range. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Range(Single, Single, Single)
Generates a 1D output tensor where the values form an arithmetic progression defined by the start
, limit
, and delta
values.
Declaration
public override TensorFloat Range(float start, float limit, float delta)
Parameters
Type | Name | Description |
---|---|---|
Single | start | The first value in the range. |
Single | limit | The limit of the range. |
Single | delta | The delta between subsequent values in the range. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Reciprocal(TensorFloat)
Computes an output tensor by applying the element-wise Reciprocal
math function: f(x) = 1 / x.
Declaration
public override TensorFloat Reciprocal(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceL1(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceL1
operation: f(x1, x2 ... xn) = |x1| + |x2| + ... + |xn|.
Declaration
public override TensorFloat ReduceL1(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceL1(TensorInt, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceL1
operation: f(x1, x2 ... xn) = |x1| + |x2| + ... + |xn|.
Declaration
public override TensorInt ReduceL1(TensorInt X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ReduceL2(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceL2
operation: f(x1, x2 ... xn) = sqrt(x1² + x2² + ... + xn²).
Declaration
public override TensorFloat ReduceL2(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceLogSum(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceLogSum
operation: f(x1, x2 ... xn) = log(x1 + x2 + ... + xn).
Declaration
public override TensorFloat ReduceLogSum(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceLogSumExp(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceLogSumExp
operation: f(x1, x2 ... xn) = log(e^x1 + e^x2 + ... + e^xn).
Declaration
public override TensorFloat ReduceLogSumExp(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceMax(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceMax
operation: f(x1, x2 ... xn) = max(x1, x2, ... , xn).
Declaration
public override TensorFloat ReduceMax(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceMax(TensorInt, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceMean
operation: f(x1, x2 ... xn) = max(x1, x2, ... , xn).
Declaration
public override TensorInt ReduceMax(TensorInt X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ReduceMean(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceMean
operation: f(x1, x2 ... xn) = (x1 + x2 + ... + xn) / n.
Declaration
public override TensorFloat ReduceMean(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceMin(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceMin
operation: f(x1, x2 ... xn) = min(x1, x2, ... , xn).
Declaration
public override TensorFloat ReduceMin(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceMin(TensorInt, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceMin
operation: f(x1, x2 ... xn) = min(x1, x2, ... , xn).
Declaration
public override TensorInt ReduceMin(TensorInt X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ReduceProd(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceProd
operation: f(x1, x2 ... xn) = x1 * x2 * ... * xn.
Declaration
public override TensorFloat ReduceProd(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceProd(TensorInt, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceProd
operation: f(x1, x2 ... xn) = x1 * x2 * ... * xn.
Declaration
public override TensorInt ReduceProd(TensorInt X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ReduceSum(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceSum
operation: f(x1, x2 ... xn) = x1 + x2 + ... + xn.
Declaration
public override TensorFloat ReduceSum(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceSum(TensorInt, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceSum
operation: f(x1, x2 ... xn) = x1 + x2 + ... + xn.
Declaration
public override TensorInt ReduceSum(TensorInt X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
ReduceSumSquare(TensorFloat, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceSumSquare
operation: f(x1, x2 ... xn) = x1² + x2² + ... + xn².
Declaration
public override TensorFloat ReduceSumSquare(TensorFloat X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ReduceSumSquare(TensorInt, Int32[], Boolean)
Reduces an input tensor along the given axes using the ReduceSumSquare
operation: f(x1, x2 ... xn) = x1² + x2² + ... + xn².
Declaration
public override TensorInt ReduceSumSquare(TensorInt X, int[] axes, bool keepdim)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Int32[] | axes | The axes along which to reduce. |
Boolean | keepdim | Whether to keep the reduced axes in the output tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Relu(TensorFloat)
Computes an output tensor by applying the element-wise Relu
activation function: f(x) = max(0, x).
Declaration
public override TensorFloat Relu(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Relu6(TensorFloat)
Computes an output tensor by applying the element-wise Relu6
activation function: f(x) = clamp(x, 0, 6).
Declaration
public override TensorFloat Relu6(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Resize(TensorFloat, Single[], InterpolationMode, NearestMode, CoordTransformMode)
Calculates an output tensor by resampling the input tensor along the spatial dimensions with given scales.
Declaration
public override TensorFloat Resize(TensorFloat X, float[] scale, InterpolationMode interpolationMode, NearestMode nearestMode = NearestMode.RoundPreferFloor, CoordTransformMode coordTransformMode = CoordTransformMode.HalfPixel)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Single[] | scale | The factor to scale each dimension by. |
InterpolationMode | interpolationMode | The |
NearestMode | nearestMode | The |
CoordTransformMode | coordTransformMode | The |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
RoiAlign(TensorFloat, TensorFloat, TensorInt, RoiPoolingMode, Int32, Int32, Int32, Single)
Calculates an output tensor by pooling the input tensor across each region of interest given by the rois
tensor.
Declaration
public override TensorFloat RoiAlign(TensorFloat X, TensorFloat Rois, TensorInt Indices, RoiPoolingMode mode, int outputHeight, int outputWidth, int samplingRatio, float spatialScale)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | Rois | The region of interest input tensor. |
TensorInt | Indices | The indices input tensor. |
RoiPoolingMode | mode | The pooling mode of the operation as an |
Int32 | outputHeight | The height of the output tensor. |
Int32 | outputWidth | The width of the output tensor. |
Int32 | samplingRatio | The number of sampling points in the interpolation grid used to compute the output value of each pooled output bin. |
Single | spatialScale | The multiplicative spatial scale factor used to translate coordinates from their input spatial scale to the scale used when pooling. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Round(TensorFloat)
Computes an output tensor by applying the element-wise Round
math function: f(x) = round(x).
If the fractional part is equal to 0.5, rounds to the nearest even integer.
Declaration
public override TensorFloat Round(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ScaleBias(TensorFloat, TensorFloat, TensorFloat)
Computes the output tensor with an element-wise ScaleBias
function: f(x, s, b) = x * s + b.
Declaration
public override TensorFloat ScaleBias(TensorFloat X, TensorFloat S, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorFloat | S | The scale tensor. |
TensorFloat | B | The bias tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ScatterElements(Tensor, TensorInt, Tensor, Int32, ScatterReductionMode)
Copies the input tensor and updates values at indexes specified by the indices
tensor with values specified by the updates
tensor along a given axis.
ScatterElements
updates the values depending on the reduction mode used.
Declaration
public override Tensor ScatterElements(Tensor X, TensorInt indices, Tensor updates, int axis, ScatterReductionMode reduction)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
TensorInt | indices | The indices tensor. |
Tensor | updates | The updates tensor. |
Int32 | axis | The axis on which to perform the scatter. |
ScatterReductionMode | reduction | The reduction mode used to update the values as a |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
ScatterND(TensorFloat, TensorInt, TensorFloat, ScatterReductionMode)
Copies the input tensor and updates values at indexes specified by the indices
tensor with values specified by the updates
tensor.
ScatterND
updates the values depending on the reduction mode used.
Declaration
public override TensorFloat ScatterND(TensorFloat X, TensorInt indices, TensorFloat updates, ScatterReductionMode reduction)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
TensorInt | indices | The indices tensor. |
TensorFloat | updates | The updates tensor. |
ScatterReductionMode | reduction | The reduction mode used to update the values as a |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ScatterND(TensorInt, TensorInt, TensorInt, ScatterReductionMode)
Copies the input tensor and updates values at indexes specified by the indices
tensor with values specified by the updates
tensor.
ScatterND
updates the values depending on the reduction mode used.
Declaration
public override TensorInt ScatterND(TensorInt X, TensorInt indices, TensorInt updates, ScatterReductionMode reduction)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
TensorInt | indices | The indices tensor. |
TensorInt | updates | The updates tensor. |
ScatterReductionMode | reduction | The reduction mode used to update the values as a |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Selu(TensorFloat, Single, Single)
Computes an output tensor by applying the element-wise Selu
activation function: f(x) = gamma * x if x >= 0, otherwise f(x) = (alpha * e^x - alpha).
Declaration
public override TensorFloat Selu(TensorFloat X, float alpha, float gamma)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | alpha | The alpha value to use for the |
Single | gamma | The alpha value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Shrink(TensorFloat, Single, Single)
Computes an output tensor by applying the element-wise Shrink
activation function: f(x) = x + bias if x < lambd. f(x) = x - bias if x > lambd. Otherwise f(x) = 0.
Declaration
public override TensorFloat Shrink(TensorFloat X, float bias, float lambd)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | bias | The bias value to use for the |
Single | lambd | The lambda value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Sigmoid(TensorFloat)
Computes an output tensor by applying the element-wise Sigmoid
activation function: f(x) = 1/(1 + e^(-x)).
Declaration
public override TensorFloat Sigmoid(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Sign(TensorFloat)
Performs an element-wise Sign
math operation: f(x) = 1 if x > 0. f(x) = -1 if x < 0. Otherwise f(x) = 0.
Declaration
public override TensorFloat Sign(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Sign(TensorInt)
Performs an element-wise Sign
math operation: f(x) = 1 if x > 0. f(x) = -1 if x < 0. Otherwise f(x) = 0.
Declaration
public override TensorInt Sign(TensorInt X)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Sin(TensorFloat)
Computes an output tensor by applying the element-wise Sin
trigonometric function: f(x) = sin(x).
Declaration
public override TensorFloat Sin(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
SinglePassLSTM(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorInt, TensorFloat, TensorFloat, TensorFloat, TensorFloat, RnnActivation[], Single[], Single[], Boolean, Single, Boolean, Int32, RnnLayout)
Computes a single pass LSTM either forward or reverse dirIndex and layout are used to calculate where to index the various tensors in bidirectional and batch first layout passes X has given layout W, R are cropped to single direction P, B are full number of directions Y has given layout and full number of directions (matches output of Layer) Y_h, Y_c are SequenceFirst layout and cropped to single direction HtxRT and XsixWT are temp vectors of the correct dimension for the intermediate results of the matmuls activations, activationAlpha and activationBeta have full number of dimensions
Declaration
protected override void SinglePassLSTM(TensorFloat X, TensorFloat W, TensorFloat R, TensorFloat B, TensorInt sequenceLens, TensorFloat P, TensorFloat Y, TensorFloat Y_h, TensorFloat Y_c, RnnActivation[] activations, float[] activationAlpha, float[] activationBeta, bool inputForget, float clip, bool isReverse, int dirIndex, RnnLayout layout)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
TensorFloat | W | |
TensorFloat | R | |
TensorFloat | B | |
TensorInt | sequenceLens | |
TensorFloat | P | |
TensorFloat | Y | |
TensorFloat | Y_h | |
TensorFloat | Y_c | |
RnnActivation[] | activations | |
Single[] | activationAlpha | |
Single[] | activationBeta | |
Boolean | inputForget | |
Single | clip | |
Boolean | isReverse | |
Int32 | dirIndex | |
RnnLayout | layout |
Overrides
Sinh(TensorFloat)
Computes an output tensor by applying the element-wise Sinh
trigonometric function: f(x) = sinh(x).
Declaration
public override TensorFloat Sinh(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Slice(Tensor, Int32[], Int32[], Int32[], Int32[])
Calculates an output tensor by slicing the input tensor along given axes with given starts, ends, and steps.
Declaration
public override Tensor Slice(Tensor X, int[] starts, int[] ends, int[] axes, int[] steps)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
Int32[] | starts | The start index along each axis. |
Int32[] | ends | The end index along each axis. |
Int32[] | axes | The axes along which to slice. If this is |
Int32[] | steps | The step values for slicing. If this is |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Softmax(TensorFloat, Int32)
Computes an output tensor by applying the Softmax
activation function along an axis: f(x, axis) = exp(X) / ReduceSum(exp(X), axis).
Declaration
public override TensorFloat Softmax(TensorFloat X, int axis)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | axis | The axis along which to apply the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Softplus(TensorFloat)
Computes an output tensor by applying the element-wise Softplus
activation function: f(x) = ln(e^x + 1).
Declaration
public override TensorFloat Softplus(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Softsign(TensorFloat)
Computes an output tensor by applying the element-wise Softsign
activation function: f(x) = x/(|x| + 1).
Declaration
public override TensorFloat Softsign(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
SpaceToDepth(TensorFloat, Int32)
Computes the output tensor by permuting data from blocks of spatial data into depth.
Declaration
public override TensorFloat SpaceToDepth(TensorFloat X, int blocksize)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Int32 | blocksize | The size of the blocks to move the depth data into. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Split(Tensor, Int32, Int32, Int32)
Calculates an output tensor by splitting the input tensor along a given axis between start and end.
Declaration
public override Tensor Split(Tensor X, int axis, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
Int32 | axis | The axis along which to split the input tensor. |
Int32 | start | The inclusive start value for the split. |
Int32 | end | The exclusive end value for the split. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Sqrt(TensorFloat)
Computes an output tensor by applying the element-wise Sqrt
math function: f(x) = sqrt(x).
Declaration
public override TensorFloat Sqrt(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Square(TensorFloat)
Computes an output tensor by applying the element-wise Square
math function: f(x) = x * x.
Declaration
public override TensorFloat Square(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Sub(TensorFloat, TensorFloat)
Performs an element-wise Sub
math operation: f(a, b) = a - b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Sub(TensorFloat A, TensorFloat B)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | A | The first input tensor. |
TensorFloat | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Sub(TensorInt, TensorInt)
Performs an element-wise Sub
math operation: f(a, b) = a - b.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorInt Sub(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |
Overrides
Sum(TensorFloat[])
Performs an element-wise Sum
math operation: f(x1, x2 ... xn) = x1 + x2 ... xn.
This supports numpy-style broadcasting of input tensors.
Declaration
public override TensorFloat Sum(TensorFloat[] tensors)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat[] | tensors | The input tensors. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Swish(TensorFloat)
Computes an output tensor by applying the element-wise Swish
activation function: f(x) = sigmoid(x) * x = x / (1 + e^{-x}).
Declaration
public override TensorFloat Swish(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Tan(TensorFloat)
Computes an output tensor by applying the element-wise Tan
trigonometric function: f(x) = tan(x).
Declaration
public override TensorFloat Tan(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Tanh(TensorFloat)
Computes an output tensor by applying the element-wise Tanh
activation function: f(x) = tanh(x).
Declaration
public override TensorFloat Tanh(TensorFloat X)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
ThresholdedRelu(TensorFloat, Single)
Computes an output tensor by applying the element-wise ThresholdedRelu
activation function: f(x) = x if x > alpha, otherwise f(x) = 0.
Declaration
public override TensorFloat ThresholdedRelu(TensorFloat X, float alpha)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | |
Single | alpha | The alpha value to use for the |
Returns
Type | Description |
---|---|
TensorFloat | The computed output tensor. |
Overrides
Tile(Tensor, Int32[])
Calculates an output tensor by repeating the input layer a given number of times along each axis.
Declaration
public override Tensor Tile(Tensor X, int[] repeats)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
Int32[] | repeats | The number of times to tile the input tensor along each axis. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
TopK(TensorFloat, Int32, Int32, Boolean, Boolean)
Calculates the top-K largest or smallest elements of an input tensor along a given axis.
Declaration
public override Tensor[] TopK(TensorFloat X, int k, int axis, bool largest, bool sorted)
Parameters
Type | Name | Description |
---|---|---|
TensorFloat | X | The input tensor. |
Int32 | k | The number of elements to calculate. |
Int32 | axis | The axis along which to perform the top-K operation. |
Boolean | largest | Whether to calculate the top-K largest elements. If this is |
Boolean | sorted | Whether to return the elements in sorted order. |
Returns
Type | Description |
---|---|
Tensor[] | The computed output tensor. |
Overrides
Transpose(Tensor)
Calculates an output tensor by reversing the dimensions of the input tensor.
Declaration
public override Tensor Transpose(Tensor X)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Transpose(Tensor, Int32[])
Calculates an output tensor by permuting the axes and data of the input tensor according to the given permutations.
Declaration
public override Tensor Transpose(Tensor X, int[] permutations)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | |
Int32[] | permutations | The axes to sample the output tensor from in the input tensor. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Tril(Tensor, Int32)
Computes the output tensor by retaining the lower triangular values from an input matrix or matrix batch and setting the other values to zero.
Declaration
public override Tensor Tril(Tensor X, int k)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
Int32 | k | The offset from the diagonal to keep. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Triu(Tensor, Int32)
Computes the output tensor by retaining the upper triangular values from an input matrix or matrix batch and setting the other values to zero.
Declaration
public override Tensor Triu(Tensor X, int k)
Parameters
Type | Name | Description |
---|---|---|
Tensor | X | The input tensor. |
Int32 | k | The offset from the diagonal to exclude. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Where(TensorInt, Tensor, Tensor)
Performs an element-wise Where
logical operation: f(condition, a, b) = a if condition
is true
, otherwise f(condition, a, b) = b.
Declaration
public override Tensor Where(TensorInt C, Tensor A, Tensor B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | C | The condition tensor. |
Tensor | A | The first input tensor. |
Tensor | B | The second input tensor. |
Returns
Type | Description |
---|---|
Tensor | The computed output tensor. |
Overrides
Xor(TensorInt, TensorInt)
Performs an element-wise Xor
logical operation: f(a) = a ^ b.
Declaration
public override TensorInt Xor(TensorInt A, TensorInt B)
Parameters
Type | Name | Description |
---|---|---|
TensorInt | A | The first input tensor. |
TensorInt | B | The second input tensor. |
Returns
Type | Description |
---|---|
TensorInt | The computed output tensor. |