docs.unity3d.com
    Show / Hide Table of Contents

    Class GPUCommandBufferBackend

    Represents a GPUCompute backend ops.

    Inheritance
    Object
    CPUBackend
    GPUCommandBufferBackend
    Inherited Members
    CPUBackend.NewOutputTensor(TensorShape, DataType)
    CPUBackend.NewOutputTensorFloat(TensorShape)
    CPUBackend.NewOutputTensorInt(TensorShape)
    CPUBackend.NewTempTensor(TensorShape, DataType)
    CPUBackend.NewTempTensorFloat(TensorShape)
    CPUBackend.NewTempTensorInt(TensorShape)
    CPUBackend.MemSet(Tensor, Int32)
    CPUBackend.ResetAllocator(Boolean)
    CPUBackend.Dispose()
    CPUBackend.LRN(TensorFloat, TensorFloat, Single, Single, Single, Int32)
    CPUBackend.ShallowCopy(Tensor, AllocScope)
    CPUBackend.ShallowReshape(Tensor, TensorShape, AllocScope)
    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 GPUCommandBufferBackend : CPUBackend, IBackend, IDisposable

    Constructors

    GPUCommandBufferBackend(ITensorAllocator)

    Initializes and returns an instance of GPUComputeOps.

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

    The allocator to use when allocating tensors.

    GPUCommandBufferBackend(CommandBuffer, ITensorAllocator)

    Create GPUCommandBufferBackend

    Declaration
    public GPUCommandBufferBackend(CommandBuffer cb, ITensorAllocator allocator = null)
    Parameters
    Type Name Description
    CommandBuffer cb

    commandbuffer

    ITensorAllocator allocator

    allocator

    Fields

    cb

    Declaration
    public CommandBuffer cb
    Field Value
    Type Description
    CommandBuffer

    Properties

    deviceType

    Returns the DeviceType for the ops.

    Declaration
    public override DeviceType deviceType { get; }
    Property Value
    Type Description
    DeviceType
    Overrides
    CPUBackend.deviceType

    Methods

    Abs(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Abs(TensorInt, TensorInt)

    Acos(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Acos(TensorFloat, TensorFloat)

    Acosh(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Add(TensorInt, TensorInt, TensorInt)

    And(TensorInt, TensorInt, TensorInt)

    Declaration
    public override void And(TensorInt A, TensorInt B, TensorInt O)
    Parameters
    Type Name Description
    TensorInt A
    TensorInt B
    TensorInt O
    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Asin(TensorFloat, TensorFloat)

    Asinh(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Asinh(TensorFloat, TensorFloat)

    Atan(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Atan(TensorFloat, TensorFloat)

    Atanh(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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().

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Cast(Tensor, Tensor)

    Ceil(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Cos(TensorFloat, TensorFloat)

    Cosh(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Cosh(TensorFloat, TensorFloat)

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

    Performs the cumulative sum along a given axis.

    Declaration
    public override 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.

    Overrides
    CPUBackend.CumSum(TensorFloat, TensorFloat, Int32, Boolean, Boolean)

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

    Performs the cumulative sum along a given axis.

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.DepthToSpace(TensorFloat, TensorFloat, Int32, DepthToSpaceMode)

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

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Div(TensorInt, TensorInt, TensorInt)

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

    Performs an Einsum math operation.

    Declaration
    public override 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
    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Erf(TensorFloat, TensorFloat)

    Exp(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Exp(TensorFloat, TensorFloat)

    Expand(Tensor, Tensor)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Expand(Tensor, Tensor)

    Floor(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.GlobalAveragePool(TensorFloat, TensorFloat)

    GlobalAverageVariancePool(TensorFloat, TensorFloat, Int32)

    Declaration
    public override void GlobalAverageVariancePool(TensorFloat X, TensorFloat O, int axis)
    Parameters
    Type Name Description
    TensorFloat X
    TensorFloat O
    Int32 axis
    Overrides
    CPUBackend.GlobalAverageVariancePool(TensorFloat, TensorFloat, Int32)

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

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.LogSoftmax(TensorFloat, TensorFloat, 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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

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

    The output tensor to be computed and filled.

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

    The output tensor to be computed and filled.

    Overrides
    CPUBackend.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 override 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.

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

    The output tensor to be computed and filled.

    Overrides
    CPUBackend.Mean(TensorFloat[], TensorFloat)

    MemClear(Tensor)

    Sets the entries of a tensor to 0.

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

    The output tensor to be computed and filled.

    Overrides
    CPUBackend.MemClear(Tensor)

    MemCopy(Tensor, Tensor)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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
    Overrides
    CPUBackend.MemCopyStride(Tensor, Tensor, Int32, Int32, Int32, Int32, Int32, Int32)

    MemSet(TensorFloat, Single)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.MemSet(TensorFloat, Single)

    MemSet(TensorInt, Int32)

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

    Declaration
    public override 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.

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

    The output tensor to be computed and filled.

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

    The output tensor to be computed and filled.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Mul(TensorInt, TensorInt, TensorInt)

    Neg(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Neg(TensorFloat, TensorFloat)

    Neg(TensorInt, TensorInt)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Neg(TensorInt, TensorInt)

    NewTensor(TensorShape, DataType, AllocScope)

    Allocates a new tensor with the internal allocator.

    Declaration
    public override Tensor NewTensor(TensorShape shape, DataType dataType, AllocScope scope)
    Parameters
    Type Name Description
    TensorShape shape
    DataType dataType
    AllocScope scope
    Returns
    Type Description
    Tensor
    Overrides
    CPUBackend.NewTensor(TensorShape, DataType, AllocScope)

    Not(TensorInt, TensorInt)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Pad(TensorFloat, TensorFloat, ReadOnlySpan<Int32>, PadMode, Single)

    PinToDevice(Tensor, Boolean)

    Prepares Tensor for use with CPU backend.

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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().

    Overrides
    CPUBackend.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 override 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().

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.ReduceSum(TensorInt, TensorInt, ReadOnlySpan<Int32>, Boolean)

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

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

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

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Relu6(TensorFloat, TensorFloat)

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

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Selu(TensorFloat, TensorFloat, Single, Single)

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

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Sign(TensorInt, TensorInt)

    Sin(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override void SinglePassLSTM(TensorFloat X, TensorFloat W, TensorFloat R, TensorFloat B, TensorInt sequenceLens, TensorFloat P, TensorFloat Y, TensorFloat Y_h, TensorFloat Y_c, RnnActivation[] activations, float[] activationAlpha, float[] activationBeta, bool inputForget, float clip, bool isReverse, int dirIndex, RnnLayout layout)
    Parameters
    Type Name Description
    TensorFloat X
    TensorFloat W
    TensorFloat R
    TensorFloat B
    TensorInt sequenceLens
    TensorFloat P
    TensorFloat Y
    TensorFloat Y_h
    TensorFloat Y_c
    RnnActivation[] activations
    Single[] activationAlpha
    Single[] activationBeta
    Boolean inputForget
    Single clip
    Boolean isReverse
    Int32 dirIndex
    RnnLayout layout
    Overrides
    CPUBackend.SinglePassLSTM(TensorFloat, TensorFloat, TensorFloat, TensorFloat, TensorInt, TensorFloat, TensorFloat, TensorFloat, TensorFloat, RnnActivation[], Single[], Single[], Boolean, Single, Boolean, Int32, RnnLayout)

    Sinh(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Softsign(TensorFloat, TensorFloat)

    SpaceToDepth(TensorFloat, TensorFloat, Int32)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Sqrt(TensorFloat, TensorFloat)

    Square(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

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

    The output tensor to be computed and filled.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Swish(TensorFloat, TensorFloat)

    Tan(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.Tan(TensorFloat, TensorFloat)

    Tanh(TensorFloat, TensorFloat)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.TopK(TensorFloat, TensorFloat, TensorInt, Int32, Int32, Boolean)

    Transpose(Tensor, Tensor)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.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 override 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.

    Overrides
    CPUBackend.Where(TensorInt, Tensor, Tensor, Tensor)

    Xor(TensorInt, TensorInt, TensorInt)

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

    Declaration
    public override 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.

    Overrides
    CPUBackend.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