docs.unity3d.com
    Show / Hide Table of Contents

    Class CPUBackend

    Represents a CPU backend ops.

    Inheritance
    Object
    CPUBackend
    GPUCommandBufferBackend
    GPUComputeBackend
    GPUPixelBackend
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Sentis
    Syntax
    public class CPUBackend : IBackend, IDisposable

    Constructors

    CPUBackend(ITensorAllocator)

    Initializes and returns an instance of CPUBackend.

    Declaration
    public CPUBackend(ITensorAllocator allocator = null)
    Parameters
    Type Name Description
    ITensorAllocator allocator

    The allocator to use when allocating tensors.

    Properties

    deviceType

    Returns the DeviceType for the ops.

    Declaration
    public virtual DeviceType deviceType { get; }
    Property Value
    Type Description
    DeviceType
    Implements
    IBackend.deviceType

    Methods

    Abs(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Abs math function: f(x) = f(x) = |x|.

    Declaration
    public virtual void Abs(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Abs(TensorFloat, TensorFloat)

    Abs(TensorInt, TensorInt)

    Computes an output tensor by applying the element-wise Abs math function: f(x) = f(x) = |x|.

    Declaration
    public virtual void Abs(TensorInt X, TensorInt O)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Abs(TensorInt, TensorInt)

    Acos(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Acos trigonometric function: f(x) = acos(x).

    Declaration
    public virtual void Acos(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Acos(TensorFloat, TensorFloat)

    Acosh(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Acosh trigonometric function: f(x) = acosh(x).

    Declaration
    public virtual void Acosh(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Acosh(TensorFloat, TensorFloat)

    Add(TensorFloat, TensorFloat, TensorFloat)

    Performs an element-wise Add math operation: f(a, b) = a + b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Add(TensorFloat A, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Add(TensorFloat, TensorFloat, TensorFloat)

    Add(TensorInt, TensorInt, TensorInt)

    Performs an element-wise Add math operation: f(a, b) = a + b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Add(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Add(TensorInt, TensorInt, TensorInt)

    And(TensorInt, TensorInt, TensorInt)

    Declaration
    public virtual void And(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A
    TensorInt B
    TensorInt O
    Implements
    IBackend.And(TensorInt, TensorInt, TensorInt)

    ArgMax(TensorFloat, TensorInt, Int32, Boolean, Boolean)

    Computes the indices of the maximum elements of the input tensor along a given axis.

    Declaration
    public virtual void ArgMax(TensorFloat X, TensorInt O, int axis, bool keepdim, bool selectLastIndex)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.ArgMax(TensorFloat, TensorInt, Int32, Boolean, Boolean)

    ArgMax(TensorInt, TensorInt, Int32, Boolean, Boolean)

    Computes the indices of the maximum elements of the input tensor along a given axis.

    Declaration
    public virtual void ArgMax(TensorInt X, TensorInt O, int axis, bool keepdim, bool selectLastIndex)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.ArgMax(TensorInt, TensorInt, Int32, Boolean, Boolean)

    ArgMin(TensorFloat, TensorInt, Int32, Boolean, Boolean)

    Computes the indices of the minimum elements of the input tensor along a given axis.

    Declaration
    public virtual void ArgMin(TensorFloat X, TensorInt O, int axis, bool keepdim, bool selectLastIndex)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.ArgMin(TensorFloat, TensorInt, Int32, Boolean, Boolean)

    ArgMin(TensorInt, TensorInt, Int32, Boolean, Boolean)

    Computes the indices of the minimum elements of the input tensor along a given axis.

    Declaration
    public virtual void ArgMin(TensorInt X, TensorInt O, int axis, bool keepdim, bool selectLastIndex)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.ArgMin(TensorInt, TensorInt, Int32, Boolean, Boolean)

    Asin(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Asin trigonometric function: f(x) = asin(x).

    Declaration
    public virtual void Asin(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Asin(TensorFloat, TensorFloat)

    Asinh(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Asinh trigonometric function: f(x) = asinh(x).

    Declaration
    public virtual void Asinh(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Asinh(TensorFloat, TensorFloat)

    Atan(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Atan trigonometric function: f(x) = atan(x).

    Declaration
    public virtual void Atan(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Atan(TensorFloat, TensorFloat)

    Atanh(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Atanh trigonometric function: f(x) = atanh(x).

    Declaration
    public virtual void Atanh(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Atanh(TensorFloat, TensorFloat)

    AveragePool(TensorFloat, 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 virtual void AveragePool(TensorFloat X, TensorFloat O, int[] kernelShape, int[] strides, int[] pads)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32[] kernelShape

    The size of the kernel along each spatial axis.

    Int32[] strides

    The stride along each spatial axis.

    Int32[] pads

    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.

    Implements
    IBackend.AveragePool(TensorFloat, TensorFloat, Int32[], Int32[], Int32[])

    BatchNormalization(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, Single)

    Computes the mean variance on the last dimension of the input tensor and normalizes it according to scale and bias tensors.

    Declaration
    public virtual void BatchNormalization(TensorFloat X, TensorFloat S, TensorFloat B, TensorFloat mean, TensorFloat variance, TensorFloat O, float epsilon)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat S

    The scale tensor.

    TensorFloat B

    The bias tensor.

    TensorFloat mean

    The mean tensor.

    TensorFloat variance

    The variance tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single epsilon

    The epsilon value the layer uses to avoid division by zero.

    Implements
    IBackend.BatchNormalization(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, Single)

    Bernoulli(TensorFloat, Tensor, 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 virtual void Bernoulli(TensorFloat X, Tensor O, float? seed)
    Parameters
    Type Name Description
    TensorFloat X

    The probabilities input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Nullable<Single> seed

    The optional seed to use for the random number generation. If this is null the operation generates a seed using System.Random().

    Implements
    IBackend.Bernoulli(TensorFloat, Tensor, Nullable<Single>)

    Cast(Tensor, Tensor)

    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 virtual void Cast(Tensor X, Tensor O)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.Cast(Tensor, Tensor)

    Ceil(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Ceil math function: f(x) = ceil(x).

    Declaration
    public virtual void Ceil(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Ceil(TensorFloat, TensorFloat)

    Celu(TensorFloat, 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 virtual void Celu(TensorFloat X, TensorFloat O, float alpha)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The alpha value to use for the Celu activation function.

    Implements
    IBackend.Celu(TensorFloat, TensorFloat, Single)

    Clip(TensorFloat, TensorFloat, Single, Single)

    Computes an output tensor by applying the element-wise Clip math function: f(x) = clamp(x, min, max).

    Declaration
    public virtual void Clip(TensorFloat X, TensorFloat O, float min, float max)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single min

    The lower clip value.

    Single max

    The upper clip value.

    Implements
    IBackend.Clip(TensorFloat, TensorFloat, Single, Single)

    CompressWithIndices(Tensor, TensorInt, Tensor, Int32, Int32)

    Computes the output tensor by selecting slices from an input tensor according to the 'indices' tensor along an 'axis'.

    Declaration
    public virtual void CompressWithIndices(Tensor X, TensorInt indices, Tensor O, int numIndices, int axis)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    TensorInt indices

    The indices tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 numIndices

    The number of indices.

    Int32 axis

    The axis along which to compress.

    Implements
    IBackend.CompressWithIndices(Tensor, TensorInt, Tensor, Int32, Int32)

    Concat(Tensor[], Tensor, Int32)

    Calculates an output tensor by concatenating the input tensors along a given axis.

    Declaration
    public virtual void Concat(Tensor[] inputs, Tensor O, int axis)
    Parameters
    Type Name Description
    Tensor[] inputs

    The input tensors.

    Tensor O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to concatenate the input tensors.

    Implements
    IBackend.Concat(Tensor[], Tensor, Int32)

    Conv(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Int32, Span<Int32>, Span<Int32>, Span<Int32>, FusableActivation)

    Applies a convolution filter to an input tensor.

    Declaration
    public virtual void Conv(TensorFloat X, TensorFloat K, TensorFloat B, TensorFloat O, int groups, Span<int> strides, Span<int> pads, Span<int> dilations, FusableActivation fusedActivation)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat K

    The filter tensor.

    TensorFloat B

    The optional bias tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32 groups

    The number of groups that input channels and output channels are divided into.

    Span<Int32> strides

    The optional stride value for each spatial dimension of the filter.

    Span<Int32> pads

    The optional lower and upper padding values for each spatial dimension of the filter.

    Span<Int32> dilations

    The optional dilation value of each spatial dimension of the filter.

    FusableActivation fusedActivation

    The fused activation type to apply after the convolution.

    Implements
    IBackend.Conv(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Int32, Span<Int32>, Span<Int32>, Span<Int32>, FusableActivation)

    ConvTranspose(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Span<Int32>, Span<Int32>, Span<Int32>, FusableActivation)

    Applies a transpose convolution filter to an input tensor.

    Declaration
    public virtual void ConvTranspose(TensorFloat X, TensorFloat W, TensorFloat B, TensorFloat O, Span<int> strides, Span<int> pads, Span<int> outputPadding, FusableActivation fusedActivation)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat W

    The filter tensor.

    TensorFloat B

    The optional bias tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Span<Int32> strides

    The optional stride value for each spatial dimension of the filter.

    Span<Int32> pads

    The optional lower and upper padding values for each spatial dimension of the filter.

    Span<Int32> outputPadding

    The output padding value for each spatial dimension in the filter.

    FusableActivation fusedActivation

    The fused activation type to apply after the convolution.

    Implements
    IBackend.ConvTranspose(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Span<Int32>, Span<Int32>, Span<Int32>, FusableActivation)

    Cos(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Cos trigonometric function: f(x) = cos(x).

    Declaration
    public virtual void Cos(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Cos(TensorFloat, TensorFloat)

    Cosh(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Cosh trigonometric function: f(x) = cosh(x).

    Declaration
    public virtual void Cosh(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Cosh(TensorFloat, TensorFloat)

    CumSum(TensorFloat, TensorFloat, Int32, Boolean, Boolean)

    Performs the cumulative sum along a given axis.

    Declaration
    public virtual void CumSum(TensorFloat X, TensorFloat O, int axis, bool reverse, bool exclusive)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.CumSum(TensorFloat, TensorFloat, Int32, Boolean, Boolean)

    CumSum(TensorInt, TensorInt, Int32, Boolean, Boolean)

    Performs the cumulative sum along a given axis.

    Declaration
    public virtual void CumSum(TensorInt X, TensorInt O, int axis, bool reverse, bool exclusive)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.CumSum(TensorInt, TensorInt, Int32, Boolean, Boolean)

    Dense(TensorFloat, 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 virtual void Dense(TensorFloat X, TensorFloat W, TensorFloat B, TensorFloat O, FusableActivation fusedActivation)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat W

    The weights tensor.

    TensorFloat B

    The bias tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    FusableActivation fusedActivation

    The fused activation to apply to the output tensor after the dense operation.

    Implements
    IBackend.Dense(TensorFloat, TensorFloat, TensorFloat, TensorFloat, FusableActivation)

    DepthToSpace(TensorFloat, TensorFloat, Int32, DepthToSpaceMode)

    Computes the output tensor by permuting data from depth into blocks of spatial data.

    Declaration
    public virtual void DepthToSpace(TensorFloat X, TensorFloat O, int blocksize, DepthToSpaceMode mode)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    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 DepthToSpaceMode.

    Implements
    IBackend.DepthToSpace(TensorFloat, TensorFloat, Int32, DepthToSpaceMode)

    Dispose()

    Disposes of the ops and any associated memory.

    Declaration
    public virtual void Dispose()
    Implements
    IDisposable.Dispose()

    Div(TensorFloat, TensorFloat, TensorFloat)

    Performs an element-wise Div math operation: f(a, b) = a / b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Div(TensorFloat A, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Div(TensorFloat, TensorFloat, TensorFloat)

    Div(TensorInt, TensorInt, TensorInt)

    Performs an element-wise Div math operation: f(a, b) = a / b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Div(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Div(TensorInt, TensorInt, TensorInt)

    Einsum(TensorFloat[], TensorFloat, TensorIndex[], TensorIndex, TensorIndex, TensorShape)

    Performs an Einsum math operation.

    Declaration
    public virtual void Einsum(TensorFloat[] inputTensors, TensorFloat O, TensorIndex[] operandIndices, TensorIndex outputIndices, TensorIndex sumIndices, TensorShape sumShape)
    Parameters
    Type Name Description
    TensorFloat[] inputTensors
    TensorFloat O
    TensorIndex[] operandIndices
    TensorIndex outputIndices
    TensorIndex sumIndices
    TensorShape sumShape
    Implements
    IBackend.Einsum(TensorFloat[], TensorFloat, TensorIndex[], TensorIndex, TensorIndex, TensorShape)

    Elu(TensorFloat, 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 virtual void Elu(TensorFloat X, TensorFloat O, float alpha)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The alpha value to use for the Elu activation function.

    Implements
    IBackend.Elu(TensorFloat, TensorFloat, Single)

    Equal(TensorFloat, TensorFloat, 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 virtual void Equal(TensorFloat A, TensorFloat B, TensorInt O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Equal(TensorFloat, TensorFloat, TensorInt)

    Equal(TensorInt, 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 virtual void Equal(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Equal(TensorInt, TensorInt, TensorInt)

    Erf(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Erf activation function: f(x) = erf(x).

    Declaration
    public virtual void Erf(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Erf(TensorFloat, TensorFloat)

    Exp(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Exp math function: f(x) = exp(x).

    Declaration
    public virtual void Exp(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Exp(TensorFloat, TensorFloat)

    Expand(Tensor, Tensor)

    Calculates an output tensor by broadcasting the input tensor into a given shape.

    Declaration
    public virtual void Expand(Tensor X, Tensor O)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.Expand(Tensor, Tensor)

    Floor(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Floor math function: f(x) = floor(x).

    Declaration
    public virtual void Floor(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Floor(TensorFloat, TensorFloat)

    FMod(TensorFloat, 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 virtual void FMod(TensorFloat A, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.FMod(TensorFloat, TensorFloat, TensorFloat)

    FMod(TensorInt, 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 virtual void FMod(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.FMod(TensorInt, TensorInt, TensorInt)

    Gather(Tensor, TensorInt, Tensor, Int32)

    Takes values from the input tensor indexed by the indices tensor along a given axis and concatenates them.

    Declaration
    public virtual void Gather(Tensor X, TensorInt indices, Tensor O, int axis)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    TensorInt indices

    The indices tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to gather.

    Implements
    IBackend.Gather(Tensor, TensorInt, Tensor, Int32)

    GatherElements(Tensor, TensorInt, Tensor, Int32)

    Takes values from the input tensor indexed by the indices tensor along a given axis and concatenates them.

    Declaration
    public virtual void GatherElements(Tensor X, TensorInt indices, Tensor O, int axis)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    TensorInt indices

    The indices tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to gather.

    Implements
    IBackend.GatherElements(Tensor, TensorInt, Tensor, Int32)

    GatherND(Tensor, TensorInt, Tensor, Int32)

    Takes slices of values from the batched input tensor indexed by the indices tensor.

    Declaration
    public virtual void GatherND(Tensor X, TensorInt indices, Tensor O, int batchDims)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    TensorInt indices

    The indices tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 batchDims

    The number of batch dimensions of the input tensor, the gather begins at the next dimension.

    Implements
    IBackend.GatherND(Tensor, TensorInt, Tensor, Int32)

    Gelu(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Gelu activation function: f(x) = x / 2 * (1 + erf(x / sqrt(2))).

    Declaration
    public virtual void Gelu(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Gelu(TensorFloat, TensorFloat)

    GlobalAveragePool(TensorFloat, 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 virtual void GlobalAveragePool(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.GlobalAveragePool(TensorFloat, TensorFloat)

    GlobalAverageVariancePool(TensorFloat, TensorFloat, Int32)

    Declaration
    public virtual void GlobalAverageVariancePool(TensorFloat X, TensorFloat O, int axis)
    Parameters
    Type Name Description
    TensorFloat X
    TensorFloat O
    Int32 axis

    GlobalMaxPool(TensorFloat, 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 virtual void GlobalMaxPool(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.GlobalMaxPool(TensorFloat, TensorFloat)

    Greater(TensorFloat, TensorFloat, 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 virtual void Greater(TensorFloat A, TensorFloat B, TensorInt O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Greater(TensorFloat, TensorFloat, TensorInt)

    Greater(TensorInt, 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 virtual void Greater(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Greater(TensorInt, TensorInt, TensorInt)

    GreaterOrEqual(TensorFloat, TensorFloat, 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 virtual void GreaterOrEqual(TensorFloat A, TensorFloat B, TensorInt O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.GreaterOrEqual(TensorFloat, TensorFloat, TensorInt)

    GreaterOrEqual(TensorInt, 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 virtual void GreaterOrEqual(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.GreaterOrEqual(TensorInt, TensorInt, TensorInt)

    Hardmax(TensorFloat, 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 virtual void Hardmax(TensorFloat X, TensorFloat O, int axis)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to apply the Hardmax activation function.

    Implements
    IBackend.Hardmax(TensorFloat, TensorFloat, Int32)

    HardSigmoid(TensorFloat, 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 virtual void HardSigmoid(TensorFloat X, TensorFloat O, float alpha, float beta)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The alpha value to use for the HardSigmoid activation function.

    Single beta

    The beta value to use for the HardSigmoid activation function.

    Implements
    IBackend.HardSigmoid(TensorFloat, TensorFloat, Single, Single)

    HardSwish(TensorFloat, 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 virtual void HardSwish(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.HardSwish(TensorFloat, TensorFloat)

    InstanceNormalization(TensorFloat, 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 virtual void InstanceNormalization(TensorFloat X, TensorFloat S, TensorFloat B, TensorFloat O, float epsilon)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat S

    The scale tensor.

    TensorFloat B

    The bias tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single epsilon

    The epsilon value the layer uses to avoid division by zero.

    Implements
    IBackend.InstanceNormalization(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Single)

    IsInf(TensorFloat, TensorInt, 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 virtual void IsInf(TensorFloat X, TensorInt O, bool detectNegative, bool detectPositive)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Boolean detectNegative

    Whether to detect negative infinities in the IsInf function.

    Boolean detectPositive

    Whether to detect positive infinities in the IsInf function.

    Implements
    IBackend.IsInf(TensorFloat, TensorInt, Boolean, Boolean)

    IsNaN(TensorFloat, TensorInt)

    Performs an element-wise IsNaN logical operation: f(x) = 1 if x is NaN, otherwise f(x) = 0.

    Declaration
    public virtual void IsNaN(TensorFloat X, TensorInt O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.IsNaN(TensorFloat, TensorInt)

    LayerNormalization(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Single)

    Computes the mean variance on the last dimension of the input tensor and normalizes it according to scale and bias tensors.

    Declaration
    public virtual void LayerNormalization(TensorFloat X, TensorFloat S, TensorFloat B, TensorFloat O, float epsilon)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat S

    The scale tensor.

    TensorFloat B

    The bias tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single epsilon

    The epsilon value the layer uses to avoid division by zero.

    Implements
    IBackend.LayerNormalization(TensorFloat, TensorFloat, TensorFloat, TensorFloat, Single)

    LeakyRelu(TensorFloat, 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 virtual void LeakyRelu(TensorFloat X, TensorFloat O, float alpha)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The alpha value to use for the LeakyRelu activation function.

    Implements
    IBackend.LeakyRelu(TensorFloat, TensorFloat, Single)

    Less(TensorFloat, TensorFloat, 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 virtual void Less(TensorFloat A, TensorFloat B, TensorInt O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Less(TensorFloat, TensorFloat, TensorInt)

    Less(TensorInt, 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 virtual void Less(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Less(TensorInt, TensorInt, TensorInt)

    LessOrEqual(TensorFloat, TensorFloat, 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 virtual void LessOrEqual(TensorFloat A, TensorFloat B, TensorInt O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.LessOrEqual(TensorFloat, TensorFloat, TensorInt)

    LessOrEqual(TensorInt, 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 virtual void LessOrEqual(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.LessOrEqual(TensorInt, TensorInt, TensorInt)

    Log(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Log math function: f(x) = log(x).

    Declaration
    public virtual void Log(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Log(TensorFloat, TensorFloat)

    LogSoftmax(TensorFloat, TensorFloat, Int32)

    Computes an output tensor by applying the LogSoftmax activation function along an axis: f(x, axis) = log(Softmax(x, axis)).

    Declaration
    public virtual void LogSoftmax(TensorFloat X, TensorFloat O, int axis)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to apply the LogSoftmax activation function.

    Implements
    IBackend.LogSoftmax(TensorFloat, TensorFloat, Int32)

    LRN(TensorFloat, TensorFloat, Single, Single, Single, Int32)

    Normalizes the input tensor over local input regions.

    Declaration
    public virtual void LRN(TensorFloat X, TensorFloat O, float alpha, float beta, float bias, int size)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The scaling parameter to use for the normalization.

    Single beta

    The exponent to use for the normalization.

    Single bias

    The bias value to use for the normalization.

    Int32 size

    The number of channels to sum over.

    Implements
    IBackend.LRN(TensorFloat, TensorFloat, Single, Single, Single, Int32)

    LSTM(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorInt, TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, RnnDirection, RnnActivation[], Single[], Single[], Boolean, Single, RnnLayout)

    Generates an output tensor by computing a one-layer long short-term memory (LSTM) on an input tensor.

    Declaration
    public virtual void LSTM(TensorFloat X, TensorFloat W, TensorFloat R, TensorFloat B, TensorInt sequenceLens, TensorFloat initialH, TensorFloat initialC, TensorFloat P, TensorFloat Y, TensorFloat Yh, TensorFloat Yc, RnnDirection direction, RnnActivation[] activations, float[] activationAlpha, float[] activationBeta, bool inputForget, float clip, RnnLayout layout)
    Parameters
    Type Name Description
    TensorFloat X

    The input sequences tensor.

    TensorFloat W

    The weights tensor for the gates of the LSTM.

    TensorFloat R

    The recurrent weights tensor for the gates of the LSTM.

    TensorFloat B

    The optional bias tensor for the input gate of the LSTM.

    TensorInt sequenceLens

    The optional 1D tensor specifying the lengths of the sequences in a batch.

    TensorFloat initialH

    The optional initial values tensor of the hidden neurons of the LSTM. If this is null, the layer uses 0.

    TensorFloat initialC

    The optional initial values tensor of the cells of the LSTM. If this is null, the layer uses 0.

    TensorFloat P

    The optional weight tensor for the peepholes of the LSTM. If this is null, the layer uses 0.

    TensorFloat Y

    The output tensor to be computed and filled with the concatenated intermediate output values of the hidden.

    TensorFloat Yh

    The output tensor to be computed and filled with the last output value of the hidden.

    TensorFloat Yc

    The output tensor to be computed and filled with the last output value of the cell.

    RnnDirection direction

    The direction of the LSTM as an RnnDirection.

    RnnActivation[] activations

    The activation functions of the LSTM as an array of RnnActivation.

    Single[] activationAlpha

    The alpha values of the activation functions of the LSTM.

    Single[] activationBeta

    The beta values of the activation functions of the LSTM.

    Boolean inputForget

    Whether to forget the input values in the LSTM. If this is false, the layer couples the input and forget gates.

    Single clip

    The cell clip threshold of the LSTM.

    RnnLayout layout

    The layout of the tensors as an RnnLayout.

    Implements
    IBackend.LSTM(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorInt, TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorFloat, RnnDirection, RnnActivation[], Single[], Single[], Boolean, Single, RnnLayout)

    MatMul(TensorFloat, TensorFloat, TensorFloat)

    Performs a multi-dimensional matrix multiplication operation: f(a, b) = a x b.

    Declaration
    public virtual void MatMul(TensorFloat X, TensorFloat Y, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The first input tensor.

    TensorFloat Y

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.MatMul(TensorFloat, TensorFloat, TensorFloat)

    MatMul2D(TensorFloat, TensorFloat, TensorFloat, Boolean, Boolean)

    Performs a matrix multiplication operation with optional transposes: f(a, b) = a' x b'.

    Declaration
    public virtual void MatMul2D(TensorFloat X, TensorFloat Y, TensorFloat O, bool xTranspose, bool yTranspose)
    Parameters
    Type Name Description
    TensorFloat X

    The first input tensor.

    TensorFloat Y

    The second input tensor.

    TensorFloat O

    The output tensor.

    Boolean xTranspose

    Whether to transpose the first input tensor before performing the matrix multiplication.

    Boolean yTranspose

    Whether to transpose the second input tensor before performing the matrix multiplication.

    Implements
    IBackend.MatMul2D(TensorFloat, TensorFloat, TensorFloat, Boolean, Boolean)

    Max(TensorFloat[], 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 virtual void Max(TensorFloat[] tensors, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat[] tensors
    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Max(TensorFloat[], TensorFloat)

    Max(TensorInt[], 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 virtual void Max(TensorInt[] tensors, TensorInt O)
    Parameters
    Type Name Description
    TensorInt[] tensors
    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Max(TensorInt[], TensorInt)

    MaxPool(TensorFloat, 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 virtual void MaxPool(TensorFloat X, TensorFloat O, int[] kernelShape, int[] strides, int[] pads)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32[] kernelShape

    The size of the kernel along each spatial axis.

    Int32[] strides

    The stride along each spatial axis.

    Int32[] pads

    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.

    Implements
    IBackend.MaxPool(TensorFloat, TensorFloat, Int32[], Int32[], Int32[])

    Mean(TensorFloat[], 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 virtual void Mean(TensorFloat[] tensors, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat[] tensors
    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Mean(TensorFloat[], TensorFloat)

    MemClear(Tensor)

    Sets the entries of a tensor to 0.

    Declaration
    public virtual void MemClear(Tensor O)
    Parameters
    Type Name Description
    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.MemClear(Tensor)

    MemCopy(Tensor, Tensor)

    Creates a copy of a given input tensor with the same shape and values.

    Declaration
    public virtual void MemCopy(Tensor X, Tensor O)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.MemCopy(Tensor, Tensor)

    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
    public virtual void MemCopyStride(Tensor X, Tensor O, int strideX, int strideO, int length, int count, int offsetX, int offsetO)
    Parameters
    Type Name Description
    Tensor X
    Tensor O
    Int32 strideX
    Int32 strideO
    Int32 length
    Int32 count
    Int32 offsetX
    Int32 offsetO
    Implements
    IBackend.MemCopyStride(Tensor, Tensor, Int32, Int32, Int32, Int32, Int32, Int32)

    MemSet(Tensor, Int32)

    Set values of O to value

    Declaration
    protected virtual void MemSet(Tensor O, int value)
    Parameters
    Type Name Description
    Tensor O
    Int32 value

    MemSet(TensorFloat, Single)

    Sets the entries of a tensor to a given fill value.

    Declaration
    public virtual void MemSet(TensorFloat O, float value)
    Parameters
    Type Name Description
    TensorFloat O

    The output tensor to be computed and filled.

    Single value

    The fill value.

    Implements
    IBackend.MemSet(TensorFloat, Single)

    MemSet(TensorInt, Int32)

    Sets the entries of a tensor to a given fill value.

    Declaration
    public virtual void MemSet(TensorInt O, int value)
    Parameters
    Type Name Description
    TensorInt O

    The output tensor to be computed and filled.

    Int32 value

    The fill value.

    Implements
    IBackend.MemSet(TensorInt, Int32)

    Min(TensorFloat[], 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 virtual void Min(TensorFloat[] tensors, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat[] tensors
    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Min(TensorFloat[], TensorFloat)

    Min(TensorInt[], 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 virtual void Min(TensorInt[] tensors, TensorInt O)
    Parameters
    Type Name Description
    TensorInt[] tensors
    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Min(TensorInt[], TensorInt)

    Mod(TensorInt, 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 virtual void Mod(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Mod(TensorInt, TensorInt, TensorInt)

    Mul(TensorFloat, TensorFloat, TensorFloat)

    Performs an element-wise Mul math operation: f(a, b) = a * b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Mul(TensorFloat A, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Mul(TensorFloat, TensorFloat, TensorFloat)

    Mul(TensorInt, TensorInt, TensorInt)

    Performs an element-wise Mul math operation: f(a, b) = a * b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Mul(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Mul(TensorInt, TensorInt, TensorInt)

    Neg(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Neg math function: f(x) = -x.

    Declaration
    public virtual void Neg(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Neg(TensorFloat, TensorFloat)

    Neg(TensorInt, TensorInt)

    Computes an output tensor by applying the element-wise Neg math function: f(x) = -x.

    Declaration
    public virtual void Neg(TensorInt X, TensorInt O)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Neg(TensorInt, TensorInt)

    NewOutputTensor(TensorShape, DataType)

    Allocate a new Tensor of a given shape and data type using the AllocScope.LayerOutput scope.

    Declaration
    public Tensor NewOutputTensor(TensorShape shape, DataType dataType)
    Parameters
    Type Name Description
    TensorShape shape
    DataType dataType
    Returns
    Type Description
    Tensor
    Implements
    IBackend.NewOutputTensor(TensorShape, DataType)

    NewOutputTensorFloat(TensorShape)

    Allocate a new TensorFloat of a given shape using the AllocScope.LayerOutput scope.

    Declaration
    public TensorFloat NewOutputTensorFloat(TensorShape shape)
    Parameters
    Type Name Description
    TensorShape shape
    Returns
    Type Description
    TensorFloat
    Implements
    IBackend.NewOutputTensorFloat(TensorShape)

    NewOutputTensorInt(TensorShape)

    Allocate a new TensorInt of a given shape using the AllocScope.LayerOutput scope.

    Declaration
    public TensorInt NewOutputTensorInt(TensorShape shape)
    Parameters
    Type Name Description
    TensorShape shape
    Returns
    Type Description
    TensorInt
    Implements
    IBackend.NewOutputTensorInt(TensorShape)

    NewTempTensor(TensorShape, DataType)

    Allocate a new Tensor of a given shape and data type using the AllocScope.InternalToLayer scope.

    Declaration
    public Tensor NewTempTensor(TensorShape shape, DataType dataType)
    Parameters
    Type Name Description
    TensorShape shape
    DataType dataType
    Returns
    Type Description
    Tensor

    NewTempTensorFloat(TensorShape)

    Allocate a new TensorFloat of a given shape using the AllocScope.InternalToLayer scope.

    Declaration
    public TensorFloat NewTempTensorFloat(TensorShape shape)
    Parameters
    Type Name Description
    TensorShape shape
    Returns
    Type Description
    TensorFloat
    Implements
    IBackend.NewTempTensorFloat(TensorShape)

    NewTempTensorInt(TensorShape)

    Allocate a new TensorInt of a given shape using the AllocScope.InternalToLayer scope.

    Declaration
    public TensorInt NewTempTensorInt(TensorShape shape)
    Parameters
    Type Name Description
    TensorShape shape
    Returns
    Type Description
    TensorInt
    Implements
    IBackend.NewTempTensorInt(TensorShape)

    NewTensor(TensorShape, DataType, AllocScope)

    Allocates a new tensor with the internal allocator.

    Declaration
    public virtual Tensor NewTensor(TensorShape shape, DataType dataType, AllocScope scope)
    Parameters
    Type Name Description
    TensorShape shape
    DataType dataType
    AllocScope scope
    Returns
    Type Description
    Tensor
    Implements
    IBackend.NewTensor(TensorShape, DataType, AllocScope)

    Not(TensorInt, TensorInt)

    Performs an element-wise Not logical operation: f(x) = ~x.

    Declaration
    public virtual void Not(TensorInt X, TensorInt O)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Not(TensorInt, TensorInt)

    OneHot(TensorInt, TensorFloat, Int32, Int32, Single, Single)

    Generates a one-hot tensor with a given depth, indices and on and off values.

    Declaration
    public virtual void OneHot(TensorInt X, TensorFloat O, int axis, int depth, float offValue, float onValue)
    Parameters
    Type Name Description
    TensorInt X
    TensorFloat O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which the operation adds the one-hot representation.

    Int32 depth

    The depth of the one-hot tensor.

    Single offValue

    The value to use for an off element.

    Single onValue

    The value to use for an on element.

    Implements
    IBackend.OneHot(TensorInt, TensorFloat, Int32, Int32, Single, Single)

    OneHot(TensorInt, TensorInt, Int32, Int32, Int32, Int32)

    Generates a one-hot tensor with a given depth, indices and on and off values.

    Declaration
    public virtual void OneHot(TensorInt X, TensorInt O, int axis, int depth, int offValue, int onValue)
    Parameters
    Type Name Description
    TensorInt X
    TensorInt O

    The output tensor to be computed and filled.

    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.

    Implements
    IBackend.OneHot(TensorInt, TensorInt, Int32, Int32, Int32, Int32)

    Or(TensorInt, TensorInt, TensorInt)

    Performs an element-wise Or logical operation: f(a, b) = a | b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Or(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Or(TensorInt, TensorInt, TensorInt)

    Pad(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, PadMode, Single)

    Calculates the output tensor by adding padding to the input tensor according to the given padding values and mode.

    Declaration
    public virtual void Pad(TensorFloat X, TensorFloat O, ReadOnlySpan<int> pad, PadMode padMode, float constant)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> pad

    The lower and upper padding values for each dimension.

    PadMode padMode

    The PadMode to use when padding.

    Single constant

    The constant value to fill with when using PadMode.Constant.

    Implements
    IBackend.Pad(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, PadMode, Single)

    PinToDevice(Tensor, Boolean)

    Prepares Tensor for use with CPU backend.

    Declaration
    public virtual Tensor PinToDevice(Tensor X, bool clearOnInit = true)
    Parameters
    Type Name Description
    Tensor X

    Tensor to prepare for CPU backend.

    Boolean clearOnInit

    Whether to copy tensor data to CPU backend.

    Returns
    Type Description
    Tensor

    Tensor once prepared for CPU backend.

    Implements
    IBackend.PinToDevice(Tensor, Boolean)

    Pow(TensorFloat, 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 virtual void Pow(TensorFloat A, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Pow(TensorFloat, TensorFloat, TensorFloat)

    Pow(TensorFloat, TensorInt, TensorFloat)

    Performs an element-wise Pow math operation: f(a, b) = pow(a, b).

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Pow(TensorFloat A, TensorInt B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Pow(TensorFloat, TensorInt, TensorFloat)

    PRelu(TensorFloat, 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 virtual void PRelu(TensorFloat X, TensorFloat S, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat S
    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.PRelu(TensorFloat, TensorFloat, TensorFloat)

    RandomNormal(TensorFloat, 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 virtual void RandomNormal(TensorFloat O, float mean, float scale, float? seed)
    Parameters
    Type Name Description
    TensorFloat O

    The output tensor to be computed and filled.

    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 null the operation generates a seed using System.Random().

    Implements
    IBackend.RandomNormal(TensorFloat, Single, Single, Nullable<Single>)

    RandomUniform(TensorFloat, 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 virtual void RandomUniform(TensorFloat O, float low, float high, float? seed)
    Parameters
    Type Name Description
    TensorFloat O

    The output tensor to be computed and filled.

    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 null the operation generates a seed using System.Random().

    Implements
    IBackend.RandomUniform(TensorFloat, Single, Single, Nullable<Single>)

    Range(TensorFloat, Single, Single)

    Generates a 1D output tensor where the values form an arithmetic progression defined by the start and delta values.

    Declaration
    public virtual void Range(TensorFloat O, float start, float delta)
    Parameters
    Type Name Description
    TensorFloat O

    The output tensor to be computed and filled.

    Single start

    The first value in the range.

    Single delta

    The delta between subsequent values in the range.

    Implements
    IBackend.Range(TensorFloat, Single, Single)

    Range(TensorInt, Int32, Int32)

    Generates a 1D output tensor where the values form an arithmetic progression defined by the start and delta values.

    Declaration
    public virtual void Range(TensorInt O, int start, int delta)
    Parameters
    Type Name Description
    TensorInt O

    The output tensor to be computed and filled.

    Int32 start

    The first value in the range.

    Int32 delta

    The delta between subsequent values in the range.

    Implements
    IBackend.Range(TensorInt, Int32, Int32)

    Reciprocal(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Reciprocal math function: f(x) = 1 / x.

    Declaration
    public virtual void Reciprocal(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Reciprocal(TensorFloat, TensorFloat)

    ReduceL1(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceL1 operation: f(x1, x2 ... xn) = |x1| + |x2| + ... + |xn|.

    Declaration
    public virtual void ReduceL1(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceL1(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceL1(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceL1 operation: f(x1, x2 ... xn) = |x1| + |x2| + ... + |xn|.

    Declaration
    public virtual void ReduceL1(TensorInt X, TensorInt O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceL1(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    ReduceL2(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceL2 operation: f(x1, x2 ... xn) = sqrt(x1² + x2² + ... + xn²).

    Declaration
    public virtual void ReduceL2(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceL2(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceLogSum(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceLogSum operation: f(x1, x2 ... xn) = log(x1 + x2 + ... + xn).

    Declaration
    public virtual void ReduceLogSum(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceLogSum(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceLogSumExp(TensorFloat, TensorFloat, ReadOnlySpan<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 virtual void ReduceLogSumExp(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceLogSumExp(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceMax(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceMax operation: f(x1, x2 ... xn) = max(x1, x2, ... , xn).

    Declaration
    public virtual void ReduceMax(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceMax(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceMax(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceMean operation: f(x1, x2 ... xn) = max(x1, x2, ... , xn).

    Declaration
    public virtual void ReduceMax(TensorInt X, TensorInt O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceMax(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    ReduceMean(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceMean operation: f(x1, x2 ... xn) = (x1 + x2 + ... + xn) / n.

    Declaration
    public virtual void ReduceMean(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceMean(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceMin(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceMin operation: f(x1, x2 ... xn) = min(x1, x2, ... , xn).

    Declaration
    public virtual void ReduceMin(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceMin(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceMin(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceMin operation: f(x1, x2 ... xn) = min(x1, x2, ... , xn).

    Declaration
    public virtual void ReduceMin(TensorInt X, TensorInt O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceMin(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    ReduceProd(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceProd operation: f(x1, x2 ... xn) = x1 * x2 * ... * xn.

    Declaration
    public virtual void ReduceProd(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceProd(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceProd(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceProd operation: f(x1, x2 ... xn) = x1 * x2 * ... * xn.

    Declaration
    public virtual void ReduceProd(TensorInt X, TensorInt O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceProd(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    ReduceSum(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceSum operation: f(x1, x2 ... xn) = x1 + x2 + ... + xn.

    Declaration
    public virtual void ReduceSum(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceSum(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceSum(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceSum operation: f(x1, x2 ... xn) = x1 + x2 + ... + xn.

    Declaration
    public virtual void ReduceSum(TensorInt X, TensorInt O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceSum(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    ReduceSumSquare(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceSumSquare operation: f(x1, x2 ... xn) = x1² + x2² + ... + xn².

    Declaration
    public virtual void ReduceSumSquare(TensorFloat X, TensorFloat O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceSumSquare(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, Boolean)

    ReduceSumSquare(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Reduces an input tensor along the given axes using the ReduceSumSquare operation: f(x1, x2 ... xn) = x1² + x2² + ... + xn².

    Declaration
    public virtual void ReduceSumSquare(TensorInt X, TensorInt O, ReadOnlySpan<int> axes, bool keepdim)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> axes

    The axes along which to reduce.

    Boolean keepdim

    Whether to keep the reduced axes in the output tensor.

    Implements
    IBackend.ReduceSumSquare(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

    Relu(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Relu activation function: f(x) = max(0, x).

    Declaration
    public virtual void Relu(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Relu(TensorFloat, TensorFloat)

    Relu6(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Relu6 activation function: f(x) = clamp(x, 0, 6).

    Declaration
    public virtual void Relu6(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Relu6(TensorFloat, TensorFloat)

    ResetAllocator(Boolean)

    Resets the internal allocator.

    Declaration
    public virtual void ResetAllocator(bool keepCachedMemory = true)
    Parameters
    Type Name Description
    Boolean keepCachedMemory
    Implements
    IBackend.ResetAllocator(Boolean)

    Reshape(Tensor, Tensor)

    Calculates an output tensor by copying the data from the input tensor and using a given shape. The data from the input tensor is unchanged.

    Declaration
    public virtual void Reshape(Tensor X, Tensor O)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.Reshape(Tensor, Tensor)

    Resize(TensorFloat, TensorFloat, ReadOnlySpan<Single>, InterpolationMode, NearestMode, CoordTransformMode)

    Calculates an output tensor by resampling the input tensor along the spatial dimensions with given scales.

    Declaration
    public virtual void Resize(TensorFloat X, TensorFloat O, ReadOnlySpan<float> scale, InterpolationMode interpolationMode, NearestMode nearestMode, CoordTransformMode coordTransformMode)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ReadOnlySpan<Single> scale

    The factor to scale each dimension by.

    InterpolationMode interpolationMode

    The InterpolationMode to use for the operation.

    NearestMode nearestMode

    The NearestMode to use for the operation when using InterpolationMode.NearestMode.

    CoordTransformMode coordTransformMode

    The CoordTransformMode to use for the operation.

    Implements
    IBackend.Resize(TensorFloat, TensorFloat, ReadOnlySpan<Single>, InterpolationMode, NearestMode, CoordTransformMode)

    RoiAlign(TensorFloat, TensorFloat, TensorInt, TensorFloat, 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 virtual void RoiAlign(TensorFloat X, TensorFloat rois, TensorInt indices, TensorFloat O, 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.

    TensorFloat O

    The output tensor to be computed and filled.

    RoiPoolingMode mode

    The pooling mode of the operation as an RoiPoolingMode.

    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.

    Implements
    IBackend.RoiAlign(TensorFloat, TensorFloat, TensorInt, TensorFloat, RoiPoolingMode, Int32, Int32, Int32, Single)

    Round(TensorFloat, 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 virtual void Round(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Round(TensorFloat, TensorFloat)

    ScalarMad(TensorFloat, TensorFloat, Single, Single)

    Performs an element-wise Mad math operation: multiplies and adds bias to a tensor: f(T, s, b) = s * T + b.

    Declaration
    public virtual void ScalarMad(TensorFloat X, TensorFloat O, float s, float b)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single s

    Input scalar for multiplication.

    Single b

    Input bias for addition.

    Implements
    IBackend.ScalarMad(TensorFloat, TensorFloat, Single, Single)

    ScaleBias(TensorFloat, TensorFloat, TensorFloat, TensorFloat)

    Computes the output tensor with an element-wise ScaleBias function: f(x, s, b) = x * s + b.

    Declaration
    public virtual void ScaleBias(TensorFloat X, TensorFloat S, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat S

    The scale tensor.

    TensorFloat B

    The bias tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.ScaleBias(TensorFloat, TensorFloat, TensorFloat, TensorFloat)

    ScatterElements(Tensor, TensorInt, Tensor, 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 virtual void ScatterElements(Tensor X, TensorInt indices, Tensor updates, Tensor O, int axis, ScatterReductionMode reduction)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    TensorInt indices

    The indices tensor.

    Tensor updates

    The updates tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 axis

    The axis on which to perform the scatter.

    ScatterReductionMode reduction

    The reduction mode used to update the values as a ScatterReductionMode.

    Implements
    IBackend.ScatterElements(Tensor, TensorInt, Tensor, Tensor, Int32, ScatterReductionMode)

    ScatterND(TensorFloat, TensorInt, TensorFloat, 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 virtual void ScatterND(TensorFloat X, TensorInt indices, TensorFloat updates, TensorFloat O, ScatterReductionMode reduction)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorInt indices

    The indices tensor.

    TensorFloat updates

    The updates tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    ScatterReductionMode reduction

    The reduction mode used to update the values as a ScatterReductionMode.

    Implements
    IBackend.ScatterND(TensorFloat, TensorInt, TensorFloat, TensorFloat, ScatterReductionMode)

    ScatterND(TensorInt, 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 virtual void ScatterND(TensorInt X, TensorInt indices, TensorInt updates, TensorInt O, ScatterReductionMode reduction)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt indices

    The indices tensor.

    TensorInt updates

    The updates tensor.

    TensorInt O

    The output tensor to be computed and filled.

    ScatterReductionMode reduction

    The reduction mode used to update the values as a ScatterReductionMode.

    Implements
    IBackend.ScatterND(TensorInt, TensorInt, TensorInt, TensorInt, ScatterReductionMode)

    Selu(TensorFloat, 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 virtual void Selu(TensorFloat X, TensorFloat O, float alpha, float gamma)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The alpha value to use for the Selu activation function.

    Single gamma

    The alpha value to use for the Selu activation function.

    Implements
    IBackend.Selu(TensorFloat, TensorFloat, Single, Single)

    ShallowCopy(Tensor, AllocScope)

    Declaration
    public virtual Tensor ShallowCopy(Tensor X, AllocScope allocScope)
    Parameters
    Type Name Description
    Tensor X
    AllocScope allocScope
    Returns
    Type Description
    Tensor
    Implements
    IBackend.ShallowCopy(Tensor, AllocScope)

    ShallowReshape(Tensor, TensorShape, AllocScope)

    Declaration
    public virtual Tensor ShallowReshape(Tensor X, TensorShape shape, AllocScope allocScope)
    Parameters
    Type Name Description
    Tensor X
    TensorShape shape
    AllocScope allocScope
    Returns
    Type Description
    Tensor
    Implements
    IBackend.ShallowReshape(Tensor, TensorShape, AllocScope)

    Shrink(TensorFloat, 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 virtual void Shrink(TensorFloat X, TensorFloat O, float bias, float lambd)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single bias

    The bias value to use for the Shrink activation function.

    Single lambd

    The lambda value to use for the Shrink activation function.

    Implements
    IBackend.Shrink(TensorFloat, TensorFloat, Single, Single)

    Sigmoid(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Sigmoid activation function: f(x) = 1/(1 + e^(-x)).

    Declaration
    public virtual void Sigmoid(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sigmoid(TensorFloat, TensorFloat)

    Sign(TensorFloat, 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 virtual void Sign(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sign(TensorFloat, TensorFloat)

    Sign(TensorInt, 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 virtual void Sign(TensorInt X, TensorInt O)
    Parameters
    Type Name Description
    TensorInt X

    The input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sign(TensorInt, TensorInt)

    Sin(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Sin trigonometric function: f(x) = sin(x).

    Declaration
    public virtual void Sin(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sin(TensorFloat, TensorFloat)

    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 virtual 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

    Sinh(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Sinh trigonometric function: f(x) = sinh(x).

    Declaration
    public virtual void Sinh(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sinh(TensorFloat, TensorFloat)

    Slice(Tensor, Tensor, ReadOnlySpan<Int32>, ReadOnlySpan<Int32>, ReadOnlySpan<Int32>)

    Calculates an output tensor by slicing the input tensor along given axes with given starts, ends, and steps.

    Declaration
    public virtual void Slice(Tensor X, Tensor O, ReadOnlySpan<int> starts, ReadOnlySpan<int> axes, ReadOnlySpan<int> steps)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> starts

    The start index along each axis.

    ReadOnlySpan<Int32> axes

    The axes along which to slice. If this is null, the layer slices all axes.

    ReadOnlySpan<Int32> steps

    The step values for slicing. If this is null, the layer uses step size 1 throughout.

    Implements
    IBackend.Slice(Tensor, Tensor, ReadOnlySpan<Int32>, ReadOnlySpan<Int32>, ReadOnlySpan<Int32>)

    Softmax(TensorFloat, 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 virtual void Softmax(TensorFloat X, TensorFloat O, int axis)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to apply the Softmax activation function.

    Implements
    IBackend.Softmax(TensorFloat, TensorFloat, Int32)

    Softplus(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Softplus activation function: f(x) = ln(e^x + 1).

    Declaration
    public virtual void Softplus(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Softplus(TensorFloat, TensorFloat)

    Softsign(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Softsign activation function: f(x) = x/(|x| + 1).

    Declaration
    public virtual void Softsign(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Softsign(TensorFloat, TensorFloat)

    SpaceToDepth(TensorFloat, TensorFloat, Int32)

    Computes the output tensor by permuting data from blocks of spatial data into depth.

    Declaration
    public virtual void SpaceToDepth(TensorFloat X, TensorFloat O, int blocksize)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Int32 blocksize

    The size of the blocks to move the depth data into.

    Implements
    IBackend.SpaceToDepth(TensorFloat, TensorFloat, Int32)

    Split(Tensor, Tensor, Int32, Int32)

    Calculates an output tensor by splitting the input tensor along a given axis between start and end.

    Declaration
    public virtual void Split(Tensor X, Tensor O, int axis, int start)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 axis

    The axis along which to split the input tensor.

    Int32 start

    The inclusive start value for the split.

    Implements
    IBackend.Split(Tensor, Tensor, Int32, Int32)

    Sqrt(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Sqrt math function: f(x) = sqrt(x).

    Declaration
    public virtual void Sqrt(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sqrt(TensorFloat, TensorFloat)

    Square(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Square math function: f(x) = x * x.

    Declaration
    public virtual void Square(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Square(TensorFloat, TensorFloat)

    Sub(TensorFloat, TensorFloat, TensorFloat)

    Performs an element-wise Sub math operation: f(a, b) = a - b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Sub(TensorFloat A, TensorFloat B, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat A

    The first input tensor.

    TensorFloat B

    The second input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sub(TensorFloat, TensorFloat, TensorFloat)

    Sub(TensorInt, TensorInt, TensorInt)

    Performs an element-wise Sub math operation: f(a, b) = a - b.

    This supports numpy-style broadcasting of input tensors.

    Declaration
    public virtual void Sub(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sub(TensorInt, TensorInt, TensorInt)

    Sum(TensorFloat[], 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 virtual void Sum(TensorFloat[] tensors, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat[] tensors
    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Sum(TensorFloat[], TensorFloat)

    Swish(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Swish activation function: f(x) = sigmoid(x) * x = x / (1 + e^{-x}).

    Declaration
    public virtual void Swish(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Swish(TensorFloat, TensorFloat)

    Tan(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Tan trigonometric function: f(x) = tan(x).

    Declaration
    public virtual void Tan(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Tan(TensorFloat, TensorFloat)

    Tanh(TensorFloat, TensorFloat)

    Computes an output tensor by applying the element-wise Tanh activation function: f(x) = tanh(x).

    Declaration
    public virtual void Tanh(TensorFloat X, TensorFloat O)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Implements
    IBackend.Tanh(TensorFloat, TensorFloat)

    ThresholdedRelu(TensorFloat, 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 virtual void ThresholdedRelu(TensorFloat X, TensorFloat O, float alpha)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat O

    The output tensor to be computed and filled.

    Single alpha

    The alpha value to use for the ThresholdedRelu activation function.

    Implements
    IBackend.ThresholdedRelu(TensorFloat, TensorFloat, Single)

    Tile(Tensor, Tensor, ReadOnlySpan<Int32>)

    Calculates an output tensor by repeating the input layer a given number of times along each axis.

    Declaration
    public virtual void Tile(Tensor X, Tensor O, ReadOnlySpan<int> repeats)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    ReadOnlySpan<Int32> repeats

    The number of times to tile the input tensor along each axis.

    Implements
    IBackend.Tile(Tensor, Tensor, ReadOnlySpan<Int32>)

    TopK(TensorFloat, TensorFloat, TensorInt, Int32, Int32, Boolean)

    Calculates the top-K largest or smallest elements of an input tensor along a given axis.

    Declaration
    public virtual void TopK(TensorFloat X, TensorFloat values, TensorInt indices, int k, int axis, bool largest)
    Parameters
    Type Name Description
    TensorFloat X

    The input tensor.

    TensorFloat values

    The output tensor to be computed and filled with the top K values from the input tensor.

    TensorInt indices

    The output tensor to be computed and filled with the corresponding input tensor indices for the top K values from 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 false, the layer calculates the top-K smallest elements.

    Implements
    IBackend.TopK(TensorFloat, TensorFloat, TensorInt, Int32, Int32, Boolean)

    Transpose(Tensor, Tensor)

    Calculates an output tensor by reversing the dimensions of the input tensor.

    Declaration
    public virtual void Transpose(Tensor X, Tensor O)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.Transpose(Tensor, Tensor)

    Transpose(Tensor, Tensor, Int32[])

    Calculates an output tensor by permuting the axes and data of the input tensor according to the given permutations.

    Declaration
    public virtual void Transpose(Tensor X, Tensor O, int[] permutations)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32[] permutations

    The axes to sample the output tensor from in the input tensor.

    Implements
    IBackend.Transpose(Tensor, Tensor, Int32[])

    Tril(Tensor, 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 virtual void Tril(Tensor X, Tensor O, int k)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 k

    The offset from the diagonal to keep.

    Implements
    IBackend.Tril(Tensor, Tensor, Int32)

    Triu(Tensor, 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 virtual void Triu(Tensor X, Tensor O, int k)
    Parameters
    Type Name Description
    Tensor X

    The input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Int32 k

    The offset from the diagonal to exclude.

    Implements
    IBackend.Triu(Tensor, Tensor, Int32)

    Where(TensorInt, Tensor, 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 virtual void Where(TensorInt C, Tensor A, Tensor B, Tensor O)
    Parameters
    Type Name Description
    TensorInt C

    The condition tensor.

    Tensor A

    The first input tensor.

    Tensor B

    The second input tensor.

    Tensor O

    The output tensor to be computed and filled.

    Implements
    IBackend.Where(TensorInt, Tensor, Tensor, Tensor)

    Xor(TensorInt, TensorInt, TensorInt)

    Performs an element-wise Xor logical operation: f(a) = a ^ b.

    Declaration
    public virtual void Xor(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A

    The first input tensor.

    TensorInt B

    The second input tensor.

    TensorInt O

    The output tensor to be computed and filled.

    Implements
    IBackend.Xor(TensorInt, TensorInt, TensorInt)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023