docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ReferenceComputeOps

    Reference GPU compute IOps implementation

    Inheritance
    object
    ReferenceCPUOps
    ReferenceComputeOps
    ComputeOps
    Implements
    IOps
    IOpsStatistics
    Inherited Members
    ReferenceCPUOps.PostLayerCleanup()
    ReferenceCPUOps.NewTensor(DataType, TensorShape, AllocScope, string)
    ReferenceCPUOps.NewTensorLike(Tensor, AllocScope)
    ReferenceCPUOps.NewTensorLike(Tensor[], AllocScope, bool)
    ReferenceCPUOps.NewTensorForFusedActivation(DataType, TensorShape, Layer.FusedActivation)
    ReferenceCPUOps.NewOutputTensor(DataType, TensorShape, string)
    ReferenceCPUOps.NewTempTensor(DataType, TensorShape, string)
    ReferenceCPUOps.ResetAllocator(bool)
    ReferenceCPUOps.SetModelExecutionsReporter(IModelExecutionsReporter)
    ReferenceCPUOps.GetModelExecutionsReporter()
    ReferenceCPUOps.Bernoulli(float)
    ReferenceCPUOps.Gaussian(float, float)
    ReferenceCPUOps.RandomNormal(TensorShape, float, float, int)
    ReferenceCPUOps.RandomUniform(TensorShape, float, float, int)
    ReferenceCPUOps.Multinomial(Tensor, int, int)
    ReferenceCPUOps.TopKIndices(Tensor, int, int, bool, bool)
    ReferenceCPUOps.NonZero(Tensor)
    ReferenceCPUOps.TopKValues(Tensor, Tensor, int)
    ReferenceCPUOps.Shape(Tensor, int)
    ReferenceCPUOps.NonMaxSuppression(Tensor[], int, float, float, int)
    ReferenceCPUOps.LSTM(Tensor, Tensor[], Tensor[], Tensor[], Tensor[], Tensor, Tensor)
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Barracuda
    Assembly: solution.dll
    Syntax
    public class ReferenceComputeOps : ReferenceCPUOps, IOps, IOpsStatistics

    Constructors

    ReferenceComputeOps(ITensorAllocator)

    Create ReferenceComputeOps

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

    allocator

    Methods

    Abs(Tensor)

    Abs

    Declaration
    public override Tensor Abs(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Abs(Tensor)

    Acos(Tensor)

    Acos

    Declaration
    public override Tensor Acos(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Acos(Tensor)

    Acosh(Tensor)

    Acosh

    Declaration
    public override Tensor Acosh(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Acosh(Tensor)

    Activation(string, Tensor, float, float)

    Generic activation function

    Declaration
    protected virtual Tensor Activation(string kernelName, Tensor X, float alpha = 0, float beta = 0)
    Parameters
    Type Name Description
    string kernelName

    kernel name

    Tensor X

    input

    float alpha

    alpha

    float beta

    beta

    Returns
    Type Description
    Tensor

    output Tensor

    Add(Tensor[])

    Add tensors together

    Declaration
    public override Tensor Add(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Add(Tensor[])

    ApplyPadding(Tensor, int[], string, float)

    Apply padding

    Declaration
    protected virtual Tensor ApplyPadding(Tensor X, int[] pad, string kernelName, float constant = 0)
    Parameters
    Type Name Description
    Tensor X

    input

    int[] pad

    padding

    string kernelName

    kernel name

    float constant

    constant

    Returns
    Type Description
    Tensor

    output Tensor

    ApplyPadding3D(Tensor, int[], string, float)

    Apply 3D padding

    Declaration
    protected virtual Tensor ApplyPadding3D(Tensor X, int[] pad, string kernelName, float constant = 0)
    Parameters
    Type Name Description
    Tensor X

    input

    int[] pad

    padding

    string kernelName

    kernel name

    float constant

    padding constant

    Returns
    Type Description
    Tensor

    output Tensor

    ArgMax(Tensor, int)

    ArgMax

    Declaration
    public override Tensor ArgMax(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ArgMax(Tensor, int)

    ArgMin(Tensor, int)

    ArgMax

    Declaration
    public override Tensor ArgMin(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ArgMin(Tensor, int)

    Asin(Tensor)

    Asin

    Declaration
    public override Tensor Asin(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Asin(Tensor)

    Asinh(Tensor)

    Asinh

    Declaration
    public override Tensor Asinh(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Asinh(Tensor)

    Atan(Tensor)

    Atan

    Declaration
    public override Tensor Atan(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Atan(Tensor)

    Atanh(Tensor)

    Atanh

    Declaration
    public override Tensor Atanh(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Atanh(Tensor)

    AvgPool2D(Tensor, int[], int[], int[])

    2D average pooling

    Declaration
    public override Tensor AvgPool2D(Tensor X, int[] pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    Tensor X
    int[] pool

    pooling

    int[] stride

    stride

    int[] pad

    padding

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.AvgPool2D(Tensor, int[], int[], int[])

    Border2D(Tensor, int[], float)

    2D border padding

    Declaration
    public override Tensor Border2D(Tensor X, int[] pad, float constant)
    Parameters
    Type Name Description
    Tensor X
    int[] pad

    padding

    float constant
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Border2D(Tensor, int[], float)

    Border3D(Tensor, int[], float)

    3D border padding

    Declaration
    public override Tensor Border3D(Tensor X, int[] pad, float constant)
    Parameters
    Type Name Description
    Tensor X
    int[] pad

    padding

    float constant
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Border3D(Tensor, int[], float)

    Ceil(Tensor)

    Ceil

    Declaration
    public override Tensor Ceil(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Ceil(Tensor)

    Clip(Tensor, float, float)

    Clip

    Declaration
    public override Tensor Clip(Tensor X, float min, float max)
    Parameters
    Type Name Description
    Tensor X
    float min

    min value

    float max

    max value

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Clip(Tensor, float, float)

    Concat(Tensor[], int)

    Concatenate tensors across axis

    Declaration
    public override Tensor Concat(Tensor[] tensors, int axis)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Concat(Tensor[], int)

    ConstantOfShape(TensorShape, DataType, float)

    Creates a constant of shape input

    Declaration
    public override Tensor ConstantOfShape(TensorShape X, DataType type, float value = 0)
    Parameters
    Type Name Description
    TensorShape X

    input shape

    DataType type

    Tensor DataType

    float value

    value

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ConstantOfShape(TensorShape, DataType, float)

    Conv2D(Tensor, Tensor, Tensor, int[], int[], FusedActivation)

    2D convolution

    Declaration
    public override Tensor Conv2D(Tensor X, Tensor K, Tensor B, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Tensor X
    Tensor K
    Tensor B
    int[] stride

    stride

    int[] pad

    padding

    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Conv2D(Tensor, Tensor, Tensor, int[], int[], Layer.FusedActivation)

    Conv2DTrans(Tensor, Tensor, Tensor, int[], int[], int[], FusedActivation)

    Transpose 2D convolution

    Declaration
    public override Tensor Conv2DTrans(Tensor X, Tensor K, Tensor B, int[] stride, int[] pad, int[] outputAdjustment, Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Tensor X
    Tensor K
    Tensor B
    int[] stride

    stride

    int[] pad

    padding

    int[] outputAdjustment

    output adjustments

    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Conv2DTrans(Tensor, Tensor, Tensor, int[], int[], int[], Layer.FusedActivation)

    Conv3D(Tensor, Tensor, Tensor, int[], int[], FusedActivation)

    3D convolution

    Declaration
    public override Tensor Conv3D(Tensor X, Tensor K, Tensor B, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Tensor X
    Tensor K
    Tensor B
    int[] stride

    stride

    int[] pad

    padding

    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Conv3D(Tensor, Tensor, Tensor, int[], int[], Layer.FusedActivation)

    ConvertPermutationToDeviceLayout(int[])

    Convert permutation list to device specific layout

    Declaration
    protected int[] ConvertPermutationToDeviceLayout(int[] permutationChannelLast)
    Parameters
    Type Name Description
    int[] permutationChannelLast

    permutations channels last

    Returns
    Type Description
    int[]

    new permutation list

    Copy(Tensor)

    Copy

    Declaration
    public override Tensor Copy(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Copy(Tensor)

    CopyAndReshape(Tensor, TensorShape)

    Copy and reshape Tensor

    Declaration
    protected override Tensor CopyAndReshape(Tensor X, TensorShape newShape)
    Parameters
    Type Name Description
    Tensor X

    input

    TensorShape newShape
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.CopyAndReshape(Tensor, TensorShape)

    CopyAndReshape_NCHW(Tensor, TensorShape)

    Copy and reshape tensor for NCHW layout

    Declaration
    protected virtual Tensor CopyAndReshape_NCHW(Tensor X, TensorShape newShape)
    Parameters
    Type Name Description
    Tensor X

    input

    TensorShape newShape

    new shape

    Returns
    Type Description
    Tensor

    output Tensor

    Cos(Tensor)

    Cos

    Declaration
    public override Tensor Cos(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Cos(Tensor)

    Cosh(Tensor)

    Cosh

    Declaration
    public override Tensor Cosh(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Cosh(Tensor)

    Dense(Tensor, Tensor, Tensor, FusedActivation)

    Dense layer (matrix multiplication) o = x ⨯ w + b

    Declaration
    public override Tensor Dense(Tensor X, Tensor W, Tensor B, Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Tensor X
    Tensor W
    Tensor B
    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Dense(Tensor, Tensor, Tensor, Layer.FusedActivation)

    Dense3(Tensor, Tensor, Tensor)

    rank3 Dense layer (matrix multiplication) o = x ⨯ w + b O: N,,W,C / X: N,,W,C / W:N,,,C / B:N,,,_

    Declaration
    public override Tensor Dense3(Tensor X, Tensor W, Tensor B)
    Parameters
    Type Name Description
    Tensor X
    Tensor W
    Tensor B
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Dense3(Tensor, Tensor, Tensor)

    DepthToSpace(Tensor, int[], DepthToSpaceMode)

    Depth to space

    Declaration
    public override Tensor DepthToSpace(Tensor X, int[] blocksize, Layer.DepthToSpaceMode mode)
    Parameters
    Type Name Description
    Tensor X
    int[] blocksize
    Layer.DepthToSpaceMode mode

    mode

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.DepthToSpace(Tensor, int[], Layer.DepthToSpaceMode)

    DepthwiseConv2D(Tensor, Tensor, Tensor, int[], int[], FusedActivation)

    Depthwise 2D convolution

    Declaration
    public override Tensor DepthwiseConv2D(Tensor X, Tensor K, Tensor B, int[] stride, int[] pad, Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Tensor X
    Tensor K
    Tensor B
    int[] stride

    stride

    int[] pad

    padding

    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.DepthwiseConv2D(Tensor, Tensor, Tensor, int[], int[], Layer.FusedActivation)

    Div(Tensor[])

    Divide tensors o = tensors[0] / tensors[1] / ... / tensors[N-1]

    Declaration
    public override Tensor Div(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Div(Tensor[])

    Dropout(Tensor, float)

    Dropout

    Declaration
    public override Tensor Dropout(Tensor X, float alpha)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Dropout(Tensor, float)

    ElementwiseWithBroadcast(string, Tensor[])

    Elementwise broadcast for specified kernel

    Declaration
    protected virtual Tensor ElementwiseWithBroadcast(string kernelName, Tensor[] tensors)
    Parameters
    Type Name Description
    string kernelName

    kernel name

    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Exceptions
    Type Condition
    NotImplementedException

    thrown if input Tensor is not compatible with 4D shape

    Elu(Tensor, float)

    ELU

    Declaration
    public override Tensor Elu(Tensor X, float alpha)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Elu(Tensor, float)

    Equal(Tensor, Tensor)

    Equal

    Declaration
    public override Tensor Equal(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a == b

    Overrides
    ReferenceCPUOps.Equal(Tensor, Tensor)

    Erf(Tensor)

    Erf

    Declaration
    public override Tensor Erf(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Erf(Tensor)

    Exp(Tensor)

    Exponent e^x

    Declaration
    public override Tensor Exp(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Exp(Tensor)

    Expand(Tensor, TensorShape)

    Expand

    Declaration
    public override Tensor Expand(Tensor X, TensorShape newShape)
    Parameters
    Type Name Description
    Tensor X
    TensorShape newShape
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Expand(Tensor, TensorShape)

    Flatten(Tensor)

    Flatten

    Declaration
    public override Tensor Flatten(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Flatten(Tensor)

    Floor(Tensor)

    Floor

    Declaration
    public override Tensor Floor(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Floor(Tensor)

    Gather(Tensor[], int)

    Gather

    Declaration
    public override Tensor Gather(Tensor[] tensors, int axis)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Gather(Tensor[], int)

    GetOnDeviceShape(TensorShape)

    Get Tensor shape on GPU device

    Declaration
    protected int[] GetOnDeviceShape(TensorShape shape)
    Parameters
    Type Name Description
    TensorShape shape

    shape

    Returns
    Type Description
    int[]

    ouput shape as int array

    GlobalAvgPool2D(Tensor)

    2D global average pooling

    Declaration
    public override Tensor GlobalAvgPool2D(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.GlobalAvgPool2D(Tensor)

    GlobalAvgVariancePool2D(Tensor)

    2D global average variance pooling

    Declaration
    public override Tensor GlobalAvgVariancePool2D(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.GlobalAvgVariancePool2D(Tensor)

    GlobalMaxPool2D(Tensor)

    2D global max pooling

    Declaration
    public override Tensor GlobalMaxPool2D(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.GlobalMaxPool2D(Tensor)

    GlobalPool2D(string, Tensor)

    Generic pooling 2D

    Declaration
    protected virtual Tensor GlobalPool2D(string kernelName, Tensor X)
    Parameters
    Type Name Description
    string kernelName

    kernel name

    Tensor X

    input

    Returns
    Type Description
    Tensor

    output Tensor

    Greater(Tensor, Tensor)

    Greater

    Declaration
    public override Tensor Greater(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a > b

    Overrides
    ReferenceCPUOps.Greater(Tensor, Tensor)

    GreaterEqual(Tensor, Tensor)

    Greater or equal

    Declaration
    public override Tensor GreaterEqual(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a >= b

    Overrides
    ReferenceCPUOps.GreaterEqual(Tensor, Tensor)

    HardSigmoid(Tensor, float, float)

    HardSigmoid

    Declaration
    public override Tensor HardSigmoid(Tensor X, float alpha, float beta)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    float beta
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.HardSigmoid(Tensor, float, float)

    IsFusedActivationSupported(FusedActivation)

    Check if fusedActivation type is supported in place

    Declaration
    protected override bool IsFusedActivationSupported(Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    bool

    true if supported

    Overrides
    ReferenceCPUOps.IsFusedActivationSupported(Layer.FusedActivation)

    LRN(Tensor, float, float, float, int)

    LRN (Local Response Normalization)

    Declaration
    public override Tensor LRN(Tensor X, float alpha, float beta, float bias, int size)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    float beta

    beta

    float bias

    bias

    int size

    size

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.LRN(Tensor, float, float, float, int)

    LeakyRelu(Tensor, float)

    Leaky ReLU

    Declaration
    public override Tensor LeakyRelu(Tensor X, float alpha)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.LeakyRelu(Tensor, float)

    Less(Tensor, Tensor)

    Less

    Declaration
    public override Tensor Less(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a < b

    Overrides
    ReferenceCPUOps.Less(Tensor, Tensor)

    LessEqual(Tensor, Tensor)

    Less or equal

    Declaration
    public override Tensor LessEqual(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a < b

    Overrides
    ReferenceCPUOps.LessEqual(Tensor, Tensor)

    Log(Tensor)

    Log

    Declaration
    public override Tensor Log(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Log(Tensor)

    LogSoftmax(Tensor, int)

    LogSoftmax

    Declaration
    public override Tensor LogSoftmax(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.LogSoftmax(Tensor, int)

    LogicalAnd(Tensor, Tensor)

    And

    Declaration
    public override Tensor LogicalAnd(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a && b

    Overrides
    ReferenceCPUOps.LogicalAnd(Tensor, Tensor)

    LogicalNot(Tensor)

    Not

    Declaration
    public override Tensor LogicalNot(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    Tensor with !x values

    Overrides
    ReferenceCPUOps.LogicalNot(Tensor)

    LogicalOr(Tensor, Tensor)

    Or

    Declaration
    public override Tensor LogicalOr(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a || b

    Overrides
    ReferenceCPUOps.LogicalOr(Tensor, Tensor)

    LogicalXor(Tensor, Tensor)

    Xor

    Declaration
    public override Tensor LogicalXor(Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with true where a xor b

    Overrides
    ReferenceCPUOps.LogicalXor(Tensor, Tensor)

    MatMul(Tensor, bool, Tensor, bool)

    Simple 2D matrix multiplication O = X ⨯ Y

    Declaration
    public override Tensor MatMul(Tensor X, bool xTranspose, Tensor Y, bool yTranspose)
    Parameters
    Type Name Description
    Tensor X

    left Tensor

    bool xTranspose

    X transposed data flag

    Tensor Y

    right Tensor

    bool yTranspose

    Y transposed data flag

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.MatMul(Tensor, bool, Tensor, bool)

    MatMul(Tensor, int, Tensor, int)

    Multidimensional Matrix multiplication o = x ⨯ y

    Declaration
    public override Tensor MatMul(Tensor X, int rankX, Tensor Y, int rankY)
    Parameters
    Type Name Description
    Tensor X
    int rankX

    rank of x

    Tensor Y
    int rankY

    rank of y

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.MatMul(Tensor, int, Tensor, int)

    Max(Tensor[])

    Max

    Declaration
    public override Tensor Max(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Max(Tensor[])

    MaxPool2D(Tensor, int[], int[], int[])

    2D max pooling

    Declaration
    public override Tensor MaxPool2D(Tensor X, int[] pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    Tensor X
    int[] pool

    pooling

    int[] stride

    stride

    int[] pad

    padding

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.MaxPool2D(Tensor, int[], int[], int[])

    Mean(Tensor[])

    Mean

    Declaration
    public override Tensor Mean(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Mean(Tensor[])

    Min(Tensor[])

    Min

    Declaration
    public override Tensor Min(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Min(Tensor[])

    Mul(Tensor[])

    Multiply tensors together

    Declaration
    public override Tensor Mul(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Mul(Tensor[])

    Neg(Tensor)

    Neg

    Declaration
    public override Tensor Neg(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Neg(Tensor)

    Normalization(Tensor, Tensor, Tensor, int, int, float, FusedActivation)

    Normalization

    Declaration
    public override Tensor Normalization(Tensor X, Tensor S, Tensor B, int pool, int axis, float epsilon, Layer.FusedActivation fusedActivation)
    Parameters
    Type Name Description
    Tensor X
    Tensor S
    Tensor B
    int pool

    pooling

    int axis

    axis

    float epsilon

    threshold

    Layer.FusedActivation fusedActivation

    fused activation type

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Normalization(Tensor, Tensor, Tensor, int, int, float, Layer.FusedActivation)

    OneHot(Tensor, int, float, float, int)

    One hot

    Declaration
    public override Tensor OneHot(Tensor X, int depth, float onValue, float offValue, int inputRank = -1)
    Parameters
    Type Name Description
    Tensor X
    int depth

    output depth

    float onValue

    on value

    float offValue

    off value

    int inputRank

    input rank helper

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.OneHot(Tensor, int, float, float, int)

    PRelu(Tensor, Tensor)

    PReLU

    Declaration
    public override Tensor PRelu(Tensor X, Tensor S)
    Parameters
    Type Name Description
    Tensor X
    Tensor S
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.PRelu(Tensor, Tensor)

    Pad2DEdge(Tensor, int[])

    Edge padding

    Declaration
    public override Tensor Pad2DEdge(Tensor X, int[] pad)
    Parameters
    Type Name Description
    Tensor X
    int[] pad

    padding

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Pad2DEdge(Tensor, int[])

    Pad2DReflect(Tensor, int[])

    Reflection padding

    Declaration
    public override Tensor Pad2DReflect(Tensor X, int[] pad)
    Parameters
    Type Name Description
    Tensor X
    int[] pad

    padding

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Pad2DReflect(Tensor, int[])

    Pad2DSymmetric(Tensor, int[])

    Symmetric padding

    Declaration
    public override Tensor Pad2DSymmetric(Tensor X, int[] pad)
    Parameters
    Type Name Description
    Tensor X
    int[] pad

    padding

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Pad2DSymmetric(Tensor, int[])

    Pin(Tensor, bool)

    Declaration
    public ComputeTensorData Pin(Tensor X, bool uploadCache = true)
    Parameters
    Type Name Description
    Tensor X
    bool uploadCache
    Returns
    Type Description
    ComputeTensorData

    Pool2D(string, Tensor, int[], int[], int[])

    Declaration
    protected virtual Tensor Pool2D(string kernelName, Tensor X, int[] pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    string kernelName
    Tensor X
    int[] pool
    int[] stride
    int[] pad
    Returns
    Type Description
    Tensor

    Pow(Tensor, float)

    Power

    Declaration
    public override Tensor Pow(Tensor X, float alpha)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Pow(Tensor, float)

    Pow(Tensor[])

    Raise tensors to the power o =tensors[0] ^ tensors[1] ^ ... ^ tensors[N-1]

    Declaration
    public override Tensor Pow(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Pow(Tensor[])

    Prepare(Tensor)

    Prepares tensor for use

    Declaration
    public override Tensor Prepare(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    Tensor

    Overrides
    ReferenceCPUOps.Prepare(Tensor)

    PrepareNoAlloc(Tensor)

    Prepares tensor for use without uploading internal data to device

    Declaration
    public override Tensor PrepareNoAlloc(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    Tensor

    Overrides
    ReferenceCPUOps.PrepareNoAlloc(Tensor)

    Reciprocal(Tensor)

    Reciprocal (1/x)

    Declaration
    public override Tensor Reciprocal(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Reciprocal(Tensor)

    ReduceMax(Tensor, int)

    Reduce with max

    Declaration
    public override Tensor ReduceMax(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ReduceMax(Tensor, int)

    ReduceMean(Tensor, int)

    Reduce with mean

    Declaration
    public override Tensor ReduceMean(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ReduceMean(Tensor, int)

    ReduceMin(Tensor, int)

    Reduce with min

    Declaration
    public override Tensor ReduceMin(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ReduceMin(Tensor, int)

    ReduceProd(Tensor, int)

    Reduce with product

    Declaration
    public override Tensor ReduceProd(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ReduceProd(Tensor, int)

    ReduceSum(Tensor, int)

    Reduce with sum

    Declaration
    public override Tensor ReduceSum(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ReduceSum(Tensor, int)

    Relu(Tensor)

    ReLU

    Declaration
    public override Tensor Relu(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Relu(Tensor)

    Relu6(Tensor)

    ReLU capped to 6

    Declaration
    public override Tensor Relu6(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Relu6(Tensor)

    Resample2D(Tensor, int[], bool)

    Resample 2D

    Declaration
    public override Tensor Resample2D(Tensor X, int[] size, bool bilinear)
    Parameters
    Type Name Description
    Tensor X
    int[] size

    size

    bool bilinear

    bilinear flag

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Resample2D(Tensor, int[], bool)

    Reshape(Tensor, TensorShape)

    Reshape

    Declaration
    public override Tensor Reshape(Tensor X, TensorShape newShape)
    Parameters
    Type Name Description
    Tensor X
    TensorShape newShape
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Reshape(Tensor, TensorShape)

    RoiAlign(Tensor, Tensor, Tensor, int, int, int, float)

    RoiAlign

    Declaration
    public override Tensor RoiAlign(Tensor X, Tensor Rois, Tensor Indices, int outputHeight, int outputWidth, int samplingRatio, float spatialScale)
    Parameters
    Type Name Description
    Tensor X
    Tensor Rois
    Tensor Indices
    int outputHeight

    outputHeight

    int outputWidth

    outputWidth

    int samplingRatio

    samplingRatio

    float spatialScale

    spatialScale

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.RoiAlign(Tensor, Tensor, Tensor, int, int, int, float)

    Round(Tensor)

    Round to nearest integer. In case of halfs, round to nearest even integer

    Declaration
    public override Tensor Round(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Round(Tensor)

    ScaleBias(Tensor, Tensor, Tensor)

    Scale bias o = s * x + b, element wise

    Declaration
    public override Tensor ScaleBias(Tensor X, Tensor S, Tensor B)
    Parameters
    Type Name Description
    Tensor X
    Tensor S
    Tensor B
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ScaleBias(Tensor, Tensor, Tensor)

    ScatterND(Tensor, Tensor, Tensor, ScatterNDReductionMode)

    ScatterND

    Declaration
    public override Tensor ScatterND(Tensor X, Tensor indices, Tensor updates, Layer.ScatterNDReductionMode reduction)
    Parameters
    Type Name Description
    Tensor X

    input tensor

    Tensor indices

    indices

    Tensor updates

    updates

    Layer.ScatterNDReductionMode reduction

    reduction mode

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.ScatterND(Tensor, Tensor, Tensor, Layer.ScatterNDReductionMode)

    Selu(Tensor, float, float)

    SELU

    Declaration
    public override Tensor Selu(Tensor X, float alpha, float gamma)
    Parameters
    Type Name Description
    Tensor X
    float alpha

    alpha

    float gamma

    gamma

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Selu(Tensor, float, float)

    ShouldFlattenInputForDenseLayer(TensorShape)

    Check if Flatten is needed for Dense layer input

    Declaration
    protected bool ShouldFlattenInputForDenseLayer(TensorShape X)
    Parameters
    Type Name Description
    TensorShape X

    input shape

    Returns
    Type Description
    bool

    true if Flatten is needed

    Sigmoid(Tensor)

    Sigmoid

    Declaration
    public override Tensor Sigmoid(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Sigmoid(Tensor)

    Sign(Tensor)

    Sign

    Declaration
    public override Tensor Sign(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    Tensor with 1 if x > 0 -1 if < 0 and 0 if == 0 values

    Overrides
    ReferenceCPUOps.Sign(Tensor)

    Sin(Tensor)

    Sin

    Declaration
    public override Tensor Sin(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Sin(Tensor)

    Sinh(Tensor)

    Sinh

    Declaration
    public override Tensor Sinh(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Sinh(Tensor)

    Softmax(Tensor, int)

    Softmax

    Declaration
    public override Tensor Softmax(Tensor X, int axis)
    Parameters
    Type Name Description
    Tensor X
    int axis

    axis

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Softmax(Tensor, int)

    Softplus(Tensor)

    Softplus

    Declaration
    public override Tensor Softplus(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Softplus(Tensor)

    SpaceToDepth(Tensor, int[])

    Space to depth

    Declaration
    public override Tensor SpaceToDepth(Tensor X, int[] blocksize)
    Parameters
    Type Name Description
    Tensor X
    int[] blocksize
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.SpaceToDepth(Tensor, int[])

    Sqrt(Tensor)

    Sqrt

    Declaration
    public override Tensor Sqrt(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Sqrt(Tensor)

    StridedSlice(Tensor, int[], int[], int[])

    Strided slice

    Declaration
    public override Tensor StridedSlice(Tensor X, int[] starts4Dor8D, int[] ends4Dor8D, int[] strides4Dor8D)
    Parameters
    Type Name Description
    Tensor X
    int[] starts4Dor8D
    int[] ends4Dor8D
    int[] strides4Dor8D

    stride

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.StridedSlice(Tensor, int[], int[], int[])

    Sub(Tensor[])

    Subtract tensors o = tensors[0] - tensors[1] - ... - tensors[N-1]

    Declaration
    public override Tensor Sub(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors

    input tensors

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Sub(Tensor[])

    Swish(Tensor)

    Swish

    Declaration
    public override Tensor Swish(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Swish(Tensor)

    Tan(Tensor)

    Tan

    Declaration
    public override Tensor Tan(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Tan(Tensor)

    Tanh(Tensor)

    Tanh

    Declaration
    public override Tensor Tanh(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Tanh(Tensor)

    TensorToRenderTexture(Tensor, RenderTexture, int, int, Vector4, Vector4, Texture3D, bool)

    Copy Tensor data to RenderTexture

    Declaration
    public void TensorToRenderTexture(Tensor X, RenderTexture target, int batch, int fromChannel, Vector4 scale, Vector4 bias, Texture3D lut, bool flipY = true)
    Parameters
    Type Name Description
    Tensor X

    source Tensor

    RenderTexture target

    target RenderTexture

    int batch

    batch

    int fromChannel

    from channel

    Vector4 scale

    scale

    Vector4 bias

    bias

    Texture3D lut

    LUT table

    bool flipY

    flips the texture along the Y dimension (optional, default: true)

    Tile(Tensor, int[])

    Tile

    Declaration
    public override Tensor Tile(Tensor X, int[] repeats)
    Parameters
    Type Name Description
    Tensor X
    int[] repeats

    repetition counts

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Tile(Tensor, int[])

    Transpose(Tensor)

    Transpose matrix

    Declaration
    public override Tensor Transpose(Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Transpose(Tensor)

    Transpose(Tensor, int[])

    Transpose according to permutations

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

    new axis order

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Transpose(Tensor, int[])

    Upsample2D(Tensor, int[], bool)

    Upsample 2D

    Declaration
    public override Tensor Upsample2D(Tensor X, int[] scale, bool bilinear)
    Parameters
    Type Name Description
    Tensor X
    int[] scale

    scale

    bool bilinear

    bilinear flag

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Upsample2D(Tensor, int[], bool)

    Upsample3D(Tensor, int[], bool)

    Upsample 3D

    Declaration
    public override Tensor Upsample3D(Tensor X, int[] scale, bool trilinear)
    Parameters
    Type Name Description
    Tensor X
    int[] scale

    scale

    bool trilinear

    trilinear flag

    Returns
    Type Description
    Tensor

    output Tensor

    Overrides
    ReferenceCPUOps.Upsample3D(Tensor, int[], bool)

    Where(Tensor, Tensor, Tensor)

    Where

    Declaration
    public override Tensor Where(Tensor C, Tensor A, Tensor B)
    Parameters
    Type Name Description
    Tensor C
    Tensor A
    Tensor B
    Returns
    Type Description
    Tensor

    Tensor with values c ? a : b

    Overrides
    ReferenceCPUOps.Where(Tensor, Tensor, Tensor)

    Implements

    IOps
    IOpsStatistics
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)