docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Functional

    Represents the static functional methods for model building and compilation.

    Inheritance
    object
    Functional
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Sentis
    Assembly: Unity.Sentis.dll
    Syntax
    public static class Functional

    Methods

    ARange(int)

    Returns a 1D tensor of size ⌈end / step⌉ with values from the interval [0, end) with a step 1 beginning from start.

    Declaration
    public static FunctionalTensor ARange(int end)
    Parameters
    Type Name Description
    int end

    The upper end of the interval.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ARange(int, int, int)

    Returns a 1D tensor of size ⌈(end − start) / step⌉ with values from the interval [start, end) with a step beginning from start.

    Declaration
    public static FunctionalTensor ARange(int start, int end, int step = 1)
    Parameters
    Type Name Description
    int start

    The value of the first element.

    int end

    The upper end of the interval.

    int step

    The delta between each element.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ARange(float)

    Returns a 1D tensor of size ⌈end / step⌉ with values from the interval [0, end) with a step 1 beginning from start.

    Declaration
    public static FunctionalTensor ARange(float end)
    Parameters
    Type Name Description
    float end

    The upper end of the interval.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ARange(float, float, float)

    Returns a 1D tensor of size ⌈(end − start) / step⌉ with values from the interval [start, end) with a step beginning from start.

    Declaration
    public static FunctionalTensor ARange(float start, float end, float step = 1)
    Parameters
    Type Name Description
    float start

    The value of the first element.

    float end

    The upper end of the interval.

    float step

    The delta between each element.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Abs(FunctionalTensor)

    Returns |input| element-wise.

    Declaration
    public static FunctionalTensor Abs(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Acos(FunctionalTensor)

    Returns acos(input) element-wise.

    Declaration
    public static FunctionalTensor Acos(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Acosh(FunctionalTensor)

    Returns acosh(input) element-wise.

    Declaration
    public static FunctionalTensor Acosh(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Add(FunctionalTensor, FunctionalTensor)

    Returns input + other element-wise.

    Declaration
    public static FunctionalTensor Add(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ArgMax(FunctionalTensor, int, bool)

    Returns the indices of the maximum value of the elements of the input along a dimension.

    Declaration
    public static FunctionalTensor ArgMax(FunctionalTensor input, int dim = 0, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ArgMin(FunctionalTensor, int, bool)

    Returns the indices of the minimum value of the elements of the input along a dimension.

    Declaration
    public static FunctionalTensor ArgMin(FunctionalTensor input, int dim = 0, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Asin(FunctionalTensor)

    Returns asin(input) element-wise.

    Declaration
    public static FunctionalTensor Asin(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Asinh(FunctionalTensor)

    Returns asinh(input) element-wise.

    Declaration
    public static FunctionalTensor Asinh(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    AtLeast1D(params FunctionalTensor[])

    Returns an array where each input tensor with rank less than 1 is expanded to rank 1.

    Declaration
    public static FunctionalTensor[] AtLeast1D(params FunctionalTensor[] tensors)
    Parameters
    Type Name Description
    FunctionalTensor[] tensors

    The input tensor array.

    Returns
    Type Description
    FunctionalTensor[]

    The output tensor array.

    AtLeast2D(params FunctionalTensor[])

    Returns an array where each input tensor with rank less than 2 is expanded to rank 2.

    Declaration
    public static FunctionalTensor[] AtLeast2D(params FunctionalTensor[] tensors)
    Parameters
    Type Name Description
    FunctionalTensor[] tensors

    The input tensor array.

    Returns
    Type Description
    FunctionalTensor[]

    The output tensor array.

    AtLeast3D(params FunctionalTensor[])

    Returns an array where each input tensor with rank less than 3 is expanded to rank 3.

    Declaration
    public static FunctionalTensor[] AtLeast3D(params FunctionalTensor[] tensors)
    Parameters
    Type Name Description
    FunctionalTensor[] tensors

    The input tensor array.

    Returns
    Type Description
    FunctionalTensor[]

    The output tensor array.

    Atan(FunctionalTensor)

    Returns atan(input) element-wise.

    Declaration
    public static FunctionalTensor Atan(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Atanh(FunctionalTensor)

    Returns atanh(input) element-wise.

    Declaration
    public static FunctionalTensor Atanh(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    AvgPool1D(FunctionalTensor, int, int?, int)

    Returns the result of a 1D average pooling of the input.

    Declaration
    public static FunctionalTensor AvgPool1D(FunctionalTensor input, int kernelSize, int? stride = null, int padding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int kernelSize

    The size of the kernel.

    int? stride

    The optional stride of the pooling. The default value is the kernel size.

    int padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    AvgPool2D(FunctionalTensor, int, int?, int)

    Returns the result of a 2D average pooling of the input.

    Declaration
    public static FunctionalTensor AvgPool2D(FunctionalTensor input, int kernelSize, int? stride = null, int padding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int kernelSize

    The size of the kernel.

    int? stride

    The optional stride of the pooling. The default value is the kernel size.

    int padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    AvgPool2D(FunctionalTensor, (int, int), (int, int)?, (int, int)?)

    Returns the result of a 2D average pooling of the input.

    Declaration
    public static FunctionalTensor AvgPool2D(FunctionalTensor input, (int, int) kernelSize, (int, int)? stride = null, (int, int)? padding = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    (int, int) kernelSize

    The size of the kernel.

    (int, int)? stride

    The optional stride of the pooling. The default value is the kernel size.

    (int, int)? padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    AvgPool3D(FunctionalTensor, int, int?, int)

    Returns the result of a 3D average pooling of the input.

    Declaration
    public static FunctionalTensor AvgPool3D(FunctionalTensor input, int kernelSize, int? stride = null, int padding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int kernelSize

    The size of the kernel.

    int? stride

    The optional stride of the pooling. The default value is the kernel size.

    int padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    AvgPool3D(FunctionalTensor, (int, int, int), (int, int, int)?, (int, int, int)?)

    Returns the result of a 3D average pooling of the input.

    Declaration
    public static FunctionalTensor AvgPool3D(FunctionalTensor input, (int, int, int) kernelSize, (int, int, int)? stride = null, (int, int, int)? padding = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    (int, int, int) kernelSize

    The size of the kernel.

    (int, int, int)? stride

    The optional stride of the pooling. The default value is the kernel size.

    (int, int, int)? padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    BatchNorm(FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, float)

    Returns the result of computing the mean variance on the second dimension of the input tensor and normalizes it according to the weight and bias.

    Declaration
    public static FunctionalTensor BatchNorm(FunctionalTensor input, FunctionalTensor runningMean, FunctionalTensor runningVar, FunctionalTensor weight, FunctionalTensor bias, float eps = 1E-05)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor runningMean

    The mean values tensor.

    FunctionalTensor runningVar

    The variance values tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The bias tensor.

    float eps

    The epsilon value used to avoid division by zero.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Bernoulli(FunctionalTensor, DataType, int?)

    Returns an output generated with values 0 and 1 from a Bernoulli distribution.

    Declaration
    public static FunctionalTensor Bernoulli(FunctionalTensor input, DataType dataType = DataType.Int, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The probabilities used for generating the output values.

    DataType dataType

    The data type of the output.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    BroadcastTo(FunctionalTensor, int[])

    Returns the input tensor broadcasted to a shape using the numpy broadcasting rules.

    Declaration
    public static FunctionalTensor BroadcastTo(this FunctionalTensor input, int[] shape)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] shape

    The shape to broadcast to.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Ceil(FunctionalTensor)

    Returns ⌈input⌉ element-wise.

    Declaration
    public static FunctionalTensor Ceil(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Celu(FunctionalTensor, float)

    Returns celu(input) element-wise.

    Declaration
    public static FunctionalTensor Celu(FunctionalTensor input, float alpha = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    float alpha

    The alpha value for the celu.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Clamp(FunctionalTensor, int, int)

    Returns input clamped to the range [min, max] element-wise.

    Declaration
    public static FunctionalTensor Clamp(FunctionalTensor input, int min, int max)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int min

    The min value.

    int max

    The max value.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Clamp(FunctionalTensor, float, float)

    Returns input clamped to the range [min, max] element-wise.

    Declaration
    public static FunctionalTensor Clamp(FunctionalTensor input, float min, float max)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    float min

    The min value.

    float max

    The max value.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Clone(FunctionalTensor)

    Returns a copy of the input.

    Declaration
    public static FunctionalTensor Clone(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Compile(Func<(FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)>)

    Compiles and returns a model from a forward method with no inputs and four outputs.

    Declaration
    public static Model Compile(this Func<(FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward)
    Parameters
    Type Name Description
    Func<(FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<(FunctionalTensor, FunctionalTensor, FunctionalTensor)>)

    Compiles and returns a model from a forward method with no inputs and three outputs.

    Declaration
    public static Model Compile(this Func<(FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward)
    Parameters
    Type Name Description
    Func<(FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<(FunctionalTensor, FunctionalTensor)>)

    Compiles and returns a model from a forward method with no inputs and two outputs.

    Declaration
    public static Model Compile(this Func<(FunctionalTensor, FunctionalTensor)> forward)
    Parameters
    Type Name Description
    Func<(FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)>, InputDef)

    Compiles and returns a model from a forward method with a single input and four outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, InputDef inputDef)
    Parameters
    Type Name Description
    Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    InputDef inputDef

    The input definition to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)>, InputDef)

    Compiles and returns a model from a forward method with a single input and three outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, InputDef inputDef)
    Parameters
    Type Name Description
    Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    InputDef inputDef

    The input definition to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor)>, InputDef)

    Compiles and returns a model from a forward method with a single input and two outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward, InputDef inputDef)
    Parameters
    Type Name Description
    Func<FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    InputDef inputDef

    The input definition to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef))

    Compiles and returns a model from a forward method with two inputs and four outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef))

    Compiles and returns a model from a forward method with two inputs and three outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef))

    Compiles and returns a model from a forward method with two inputs and two outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with three inputs and four outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with three inputs and three outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with three inputs and two outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with four inputs and four outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with four inputs and three outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)>, (InputDef, InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with four inputs and two outputs.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward, (InputDef, InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, (FunctionalTensor, FunctionalTensor)> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor>, (InputDef, InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with four inputs and a single output.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor> forward, (InputDef, InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor>, (InputDef, InputDef, InputDef))

    Compiles and returns a model from a forward method with three inputs and a single output.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor> forward, (InputDef, InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor, FunctionalTensor> forward

    The forward method to compile.

    (InputDef, InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor, FunctionalTensor>, (InputDef, InputDef))

    Compiles and returns a model from a forward method with two inputs and a single output.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor, FunctionalTensor> forward, (InputDef, InputDef) inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor, FunctionalTensor> forward

    The forward method to compile.

    (InputDef, InputDef) inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor, FunctionalTensor>, InputDef)

    Compiles and returns a model from a forward method with a single input and a single output.

    Declaration
    public static Model Compile(this Func<FunctionalTensor, FunctionalTensor> forward, InputDef inputDef)
    Parameters
    Type Name Description
    Func<FunctionalTensor, FunctionalTensor> forward

    The forward method to compile.

    InputDef inputDef

    The input definition to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor[], FunctionalTensor[]>, InputDef[])

    Compiles a forward method into a model.

    Declaration
    public static Model Compile(this Func<FunctionalTensor[], FunctionalTensor[]> forward, InputDef[] inputDefs)
    Parameters
    Type Name Description
    Func<FunctionalTensor[], FunctionalTensor[]> forward

    The forward method to compile.

    InputDef[] inputDefs

    The input definitions to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Compile(Func<FunctionalTensor>)

    Compiles and returns a model from a forward method with no inputs and a single output.

    Declaration
    public static Model Compile(this Func<FunctionalTensor> forward)
    Parameters
    Type Name Description
    Func<FunctionalTensor> forward

    The forward method to compile.

    Returns
    Type Description
    Model

    The compiled model.

    Concat(FunctionalTensor[], int)

    Returns the input tensors concatenated along a dimension.

    Declaration
    public static FunctionalTensor Concat(FunctionalTensor[] tensors, int dim = 0)
    Parameters
    Type Name Description
    FunctionalTensor[] tensors

    The input tensors.

    int dim

    The dimension along which to concatenate.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Conv1D(FunctionalTensor, FunctionalTensor, FunctionalTensor, int, int, int, int)

    Returns the result of a 1D convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor Conv1D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, int stride = 1, int padding = 0, int dilation = 1, int groups = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    int stride

    The stride value for each spatial dimension of the filter.

    int padding

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

    int dilation

    The dilation value of each spatial dimension of the filter.

    int groups

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Conv2D(FunctionalTensor, FunctionalTensor, FunctionalTensor, int, int, int, int)

    Returns the result of a 2D convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor Conv2D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, int stride = 1, int padding = 0, int dilation = 1, int groups = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    int stride

    The stride value for each spatial dimension of the filter.

    int padding

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

    int dilation

    The dilation value of each spatial dimension of the filter.

    int groups

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Conv2D(FunctionalTensor, FunctionalTensor, FunctionalTensor, (int, int), (int, int), (int, int), int)

    Returns the result of a 2D convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor Conv2D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, (int, int) stride, (int, int) padding, (int, int) dilation, int groups = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    (int, int) stride

    The stride value for each spatial dimension of the filter.

    (int, int) padding

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

    (int, int) dilation

    The dilation value of each spatial dimension of the filter.

    int groups

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Conv3D(FunctionalTensor, FunctionalTensor, FunctionalTensor, int, int, int, int)

    Returns the result of a 3D convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor Conv3D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, int stride = 1, int padding = 0, int dilation = 1, int groups = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    int stride

    The stride value for each spatial dimension of the filter.

    int padding

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

    int dilation

    The dilation value of each spatial dimension of the filter.

    int groups

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Conv3D(FunctionalTensor, FunctionalTensor, FunctionalTensor, (int, int, int), (int, int, int), (int, int, int), int)

    Returns the result of a 3D convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor Conv3D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, (int, int, int) stride, (int, int, int) padding, (int, int, int) dilation, int groups = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    (int, int, int) stride

    The stride value for each spatial dimension of the filter.

    (int, int, int) padding

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

    (int, int, int) dilation

    The dilation value of each spatial dimension of the filter.

    int groups

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ConvTranspose1D(FunctionalTensor, FunctionalTensor, FunctionalTensor, int, int, int)

    Returns the result of a 1D transposed convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor ConvTranspose1D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, int stride = 1, int padding = 0, int outputPadding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    int stride

    The stride value for each spatial dimension of the filter.

    int padding

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

    int outputPadding

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ConvTranspose2D(FunctionalTensor, FunctionalTensor, FunctionalTensor, int, int, int)

    Returns the result of a 2D transposed convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor ConvTranspose2D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, int stride = 1, int padding = 0, int outputPadding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    int stride

    The stride value for each spatial dimension of the filter.

    int padding

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

    int outputPadding

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ConvTranspose2D(FunctionalTensor, FunctionalTensor, FunctionalTensor, (int, int), (int, int), (int, int))

    Returns the result of a 2D transposed convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor ConvTranspose2D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, (int, int) stride, (int, int) padding, (int, int) outputPadding)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    (int, int) stride

    The stride value for each spatial dimension of the filter.

    (int, int) padding

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

    (int, int) outputPadding

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ConvTranspose3D(FunctionalTensor, FunctionalTensor, FunctionalTensor, int, int, int)

    Returns the result of a 3D transposed convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor ConvTranspose3D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, int stride = 1, int padding = 0, int outputPadding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    int stride

    The stride value for each spatial dimension of the filter.

    int padding

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

    int outputPadding

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ConvTranspose3D(FunctionalTensor, FunctionalTensor, FunctionalTensor, (int, int, int), (int, int, int), (int, int, int))

    Returns the result of a 3D transposed convolution of the input with the weight and bias tensors.

    Declaration
    public static FunctionalTensor ConvTranspose3D(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, (int, int, int) stride, (int, int, int) padding, (int, int, int) outputPadding)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The optional bias tensor.

    (int, int, int) stride

    The stride value for each spatial dimension of the filter.

    (int, int, int) padding

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

    (int, int, int) outputPadding

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

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Cos(FunctionalTensor)

    Returns cos(input) element-wise.

    Declaration
    public static FunctionalTensor Cos(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Cosh(FunctionalTensor)

    Returns cosh(input) element-wise.

    Declaration
    public static FunctionalTensor Cosh(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    CumSum(FunctionalTensor, int)

    Returns the cumulative sum of the elements of the input in a dimension.

    Declaration
    public static FunctionalTensor CumSum(FunctionalTensor input, int dim)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension in which to sum.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Deg2Rad(FunctionalTensor)

    Returns the input values converted from angles in degrees to radians element-wise.

    Declaration
    public static FunctionalTensor Deg2Rad(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Div(FunctionalTensor, FunctionalTensor)

    Returns input / other element-wise.

    Declaration
    public static FunctionalTensor Div(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Einsum(string, params FunctionalTensor[])

    Returns the sums the product of the elements of the input tensors along dimensions specified using a notation based on the Einstein summation convention.

    Declaration
    public static FunctionalTensor Einsum(string equation, params FunctionalTensor[] operands)
    Parameters
    Type Name Description
    string equation

    The equation of the Einstein summation as a comma-separated list of subscript labels.

    FunctionalTensor[] operands

    The input tensors.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Elu(FunctionalTensor, float)

    Returns elu(input) element-wise.

    Declaration
    public static FunctionalTensor Elu(FunctionalTensor input, float alpha = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    float alpha

    The alpha value for the elu.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Equals(FunctionalTensor, int)

    Returns input == value element-wise.

    Declaration
    public static FunctionalTensor Equals(FunctionalTensor input, int value)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    int value

    The integer value.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Equals(FunctionalTensor, float)

    Returns input == value element-wise.

    Declaration
    public static FunctionalTensor Equals(FunctionalTensor input, float value)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    float value

    The float value.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Equals(FunctionalTensor, FunctionalTensor)

    Returns input == other element-wise.

    Declaration
    public static FunctionalTensor Equals(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Erf(FunctionalTensor)

    Returns the error function of input element-wise.

    Declaration
    public static FunctionalTensor Erf(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Exp(FunctionalTensor)

    Returns e^input element-wise.

    Declaration
    public static FunctionalTensor Exp(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FMod(FunctionalTensor, FunctionalTensor)

    Returns input % other element-wise. The sign of the output is the same as that of the dividend.

    Declaration
    public static FunctionalTensor FMod(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Flip(FunctionalTensor, int[])

    Returns the input tensor with its elements reversed on some dimensions.

    Declaration
    public static FunctionalTensor Flip(this FunctionalTensor input, int[] dims)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dims

    The dimensions on which to reverse the elements, values may not repeat.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FlipLR(FunctionalTensor)

    Returns the input tensor with its elements reversed on the second dimension.

    Declaration
    public static FunctionalTensor FlipLR(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FlipUD(FunctionalTensor)

    Returns the input tensor with its elements reversed on the first dimension.

    Declaration
    public static FunctionalTensor FlipUD(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Float(FunctionalTensor)

    Returns the input cast to floats element-wise.

    Declaration
    public static FunctionalTensor Float(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FloatPower(FunctionalTensor, FunctionalTensor)

    Returns input^exponent element-wise.

    Declaration
    public static FunctionalTensor FloatPower(FunctionalTensor input, FunctionalTensor exponent)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor exponent

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Floor(FunctionalTensor)

    Returns ⌊input⌋ element-wise.

    Declaration
    public static FunctionalTensor Floor(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FloorDivide(FunctionalTensor, FunctionalTensor)

    Returns ⌊input/other⌋ element-wise.

    Declaration
    public static FunctionalTensor FloorDivide(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Frac(FunctionalTensor)

    Returns the fractional part of the input element-wise.

    Declaration
    public static FunctionalTensor Frac(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Full(int[], int)

    Returns a tensor filled with a constant value with a shape.

    Declaration
    public static FunctionalTensor Full(int[] size, int fillValue)
    Parameters
    Type Name Description
    int[] size

    The shape of the tensor.

    int fillValue

    The fill value of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Full(int[], float)

    Returns a tensor filled with a constant value with a shape.

    Declaration
    public static FunctionalTensor Full(int[] size, float fillValue)
    Parameters
    Type Name Description
    int[] size

    The shape of the tensor.

    float fillValue

    The fill value of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FullLike(FunctionalTensor, int)

    Returns a tensor filled with a constant value with the same shape as the input tensor.

    Declaration
    public static FunctionalTensor FullLike(FunctionalTensor input, int fillValue)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int fillValue

    The fill value of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    FullLike(FunctionalTensor, float)

    Returns a tensor filled with a constant value with the same shape as the input tensor.

    Declaration
    public static FunctionalTensor FullLike(FunctionalTensor input, float fillValue)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    float fillValue

    The fill value of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Gather(FunctionalTensor, int, FunctionalTensor)

    Returns the input tensor gathered along a dimension with indices.

    Declaration
    public static FunctionalTensor Gather(this FunctionalTensor input, int dim, FunctionalTensor index)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to gather.

    FunctionalTensor index

    The indices tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Gelu(FunctionalTensor)

    Returns gelu(input) element-wise.

    Declaration
    public static FunctionalTensor Gelu(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Greater(FunctionalTensor, FunctionalTensor)

    Returns input > other element-wise.

    Declaration
    public static FunctionalTensor Greater(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    GreaterEqual(FunctionalTensor, FunctionalTensor)

    Returns input ≥ other element-wise.

    Declaration
    public static FunctionalTensor GreaterEqual(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    GridSample(FunctionalTensor, FunctionalTensor, string, string, bool)

    Returns the input tensor by sampled by coordinates given by the grid tensor.

    Declaration
    public static FunctionalTensor GridSample(FunctionalTensor input, FunctionalTensor grid, string mode = "bilinear", string paddingMode = "zeros", bool alignCorners = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor grid

    The grid tensor containing the spatial coordinates per output pixel.

    string mode

    The mode used for interpolating, can be 'nearest', 'bilinear', or 'bicubic'.

    string paddingMode

    The mode to use for sampling out-of-bounds coordinates, can be 'zeros', 'border', or 'reflection'.

    bool alignCorners

    Whether to map the extreme values in the coordinates 0 and 1 to the centre of the corner pixels rather than the outer corners.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    HardSigmoid(FunctionalTensor)

    Returns hard_sigmoid(input) element-wise.

    Declaration
    public static FunctionalTensor HardSigmoid(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    HardSwish(FunctionalTensor)

    Returns hardswish(input) element-wise.

    Declaration
    public static FunctionalTensor HardSwish(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    InstanceNorm(FunctionalTensor, FunctionalTensor, FunctionalTensor, float)

    Returns the result of computing the mean variance on the spatial dimensions of the input tensor and normalizes it according to the weight and bias.

    Declaration
    public static FunctionalTensor InstanceNorm(FunctionalTensor input, FunctionalTensor weight, FunctionalTensor bias, float eps = 1E-05)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    FunctionalTensor bias

    The bias tensor.

    float eps

    The epsilon value used to avoid division by zero.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Int(FunctionalTensor)

    Returns the input cast to integers element-wise.

    Declaration
    public static FunctionalTensor Int(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Interpolate(FunctionalTensor, int[], float[], string)

    Returns the input tensor with the spatial dimensions downsampled or upsampled to a size or by a scale factor.

    Declaration
    public static FunctionalTensor Interpolate(FunctionalTensor input, int[] size = null, float[] scaleFactor = null, string mode = "nearest")
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] size

    The optional output size.

    float[] scaleFactor

    The optional output scale factors.

    string mode

    The mode used for interpolating, can be 'nearest', 'linear', or 'bicubic'.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    IsFinite(FunctionalTensor)

    Returns an integer tensor with elements representing if each element of the input is finite.

    Declaration
    public static FunctionalTensor IsFinite(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    IsInf(FunctionalTensor)

    Returns an integer tensor with elements representing if each element of the input is positive or negative infinity.

    Declaration
    public static FunctionalTensor IsInf(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    IsNaN(FunctionalTensor)

    Returns an integer tensor with elements representing if each element of the input is NaN.

    Declaration
    public static FunctionalTensor IsNaN(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LeakyRelu(FunctionalTensor, float)

    Returns leaky_relu(input) element-wise.

    Declaration
    public static FunctionalTensor LeakyRelu(FunctionalTensor input, float negativeSlope = 0.01)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    float negativeSlope

    The negative slope value for the leaky relu.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Lerp(FunctionalTensor, FunctionalTensor, float)

    Returns the linear interpolation input + weight * (end - input) element-wise.

    Declaration
    public static FunctionalTensor Lerp(FunctionalTensor input, FunctionalTensor end, float weight)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor end

    The second input tensor.

    float weight

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Less(FunctionalTensor, FunctionalTensor)

    Returns input < other element-wise.

    Declaration
    public static FunctionalTensor Less(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LessEqual(FunctionalTensor, FunctionalTensor)

    Returns input ≤ other element-wise.

    Declaration
    public static FunctionalTensor LessEqual(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LinSpace(float, float, int)

    Returns a 1D tensor of size steps with values evenly spaced from the interval [start, end].

    Declaration
    public static FunctionalTensor LinSpace(float start, float end, int steps)
    Parameters
    Type Name Description
    float start

    The value of the first element.

    float end

    The value of the last element.

    int steps

    The number of elements.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LocalResponseNorm(FunctionalTensor, int, float, float, float)

    Returns the result of normalizing the input tensor over local input regions.

    Declaration
    public static FunctionalTensor LocalResponseNorm(FunctionalTensor input, int size, float alpha = 0.0001, float beta = 0.75, float k = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int size

    The size of the regions used for normalization.

    float alpha

    The multiplicative factor in the normalization.

    float beta

    The exponent in the normalization.

    float k

    The additive factor in the normalization.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Log(FunctionalTensor)

    Returns log(input) element-wise.

    Declaration
    public static FunctionalTensor Log(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Log10(FunctionalTensor)

    Returns log10(input) element-wise.

    Declaration
    public static FunctionalTensor Log10(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Log1P(FunctionalTensor)

    Returns log(input + 1) element-wise.

    Declaration
    public static FunctionalTensor Log1P(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Log2(FunctionalTensor)

    Returns log2(input) element-wise.

    Declaration
    public static FunctionalTensor Log2(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogAddExp(FunctionalTensor, FunctionalTensor)

    Returns log(e^input + e^other) element-wise.

    Declaration
    public static FunctionalTensor LogAddExp(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogSoftmax(FunctionalTensor, int)

    Returns log(softmax(input)) element-wise along a dimension.

    Declaration
    public static FunctionalTensor LogSoftmax(FunctionalTensor input, int dim = -1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to calculate the softmax.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogSpace(float, float, int, float)

    Returns a 1D tensor of size steps with values evenly spaced from the interval [logBase^start, logBase^end] on a logarithmic scale.

    Declaration
    public static FunctionalTensor LogSpace(float start, float end, int steps, float logBase = 10)
    Parameters
    Type Name Description
    float start

    The value of the first exponent.

    float end

    The value of the last exponent.

    int steps

    The number of elements.

    float logBase

    The base of the logarithm.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogicalAnd(FunctionalTensor, FunctionalTensor)

    Returns the logical AND input & other element-wise.

    Declaration
    public static FunctionalTensor LogicalAnd(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogicalNot(FunctionalTensor)

    Returns the logical NOT ~input element-wise.

    Declaration
    public static FunctionalTensor LogicalNot(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogicalOr(FunctionalTensor, FunctionalTensor)

    Returns the logical OR input | other element-wise.

    Declaration
    public static FunctionalTensor LogicalOr(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    LogicalXor(FunctionalTensor, FunctionalTensor)

    Returns the logical XOR input | other element-wise.

    Declaration
    public static FunctionalTensor LogicalXor(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MatMul(FunctionalTensor, FunctionalTensor)

    Returns the matrix product input x other.

    Declaration
    public static FunctionalTensor MatMul(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Max(FunctionalTensor, FunctionalTensor)

    Returns the element-wise maximum of input and other.

    Declaration
    public static FunctionalTensor Max(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MaxPool1D(FunctionalTensor, int, int?, int)

    Returns the result of a 1D maximum pooling of the input.

    Declaration
    public static FunctionalTensor MaxPool1D(FunctionalTensor input, int kernelSize, int? stride = null, int padding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int kernelSize

    The size of the kernel.

    int? stride

    The optional stride of the pooling. The default value is the kernel size.

    int padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MaxPool2D(FunctionalTensor, int, int?, int)

    Returns the result of a 2D maximum pooling of the input.

    Declaration
    public static FunctionalTensor MaxPool2D(FunctionalTensor input, int kernelSize, int? stride = null, int padding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int kernelSize

    The size of the kernel.

    int? stride

    The optional stride of the pooling. The default value is the kernel size.

    int padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MaxPool2D(FunctionalTensor, (int, int), (int, int)?, (int, int)?)

    Returns the result of a 2D maximum pooling of the input.

    Declaration
    public static FunctionalTensor MaxPool2D(FunctionalTensor input, (int, int) kernelSize, (int, int)? stride = null, (int, int)? padding = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    (int, int) kernelSize

    The size of the kernel.

    (int, int)? stride

    The optional stride of the pooling. The default value is the kernel size.

    (int, int)? padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MaxPool3D(FunctionalTensor, int, int?, int)

    Returns the result of a 3D maximum pooling of the input.

    Declaration
    public static FunctionalTensor MaxPool3D(FunctionalTensor input, int kernelSize, int? stride = null, int padding = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int kernelSize

    The size of the kernel.

    int? stride

    The optional stride of the pooling. The default value is the kernel size.

    int padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MaxPool3D(FunctionalTensor, (int, int, int), (int, int, int)?, (int, int, int)?)

    Returns the result of a 3D maximum pooling of the input.

    Declaration
    public static FunctionalTensor MaxPool3D(FunctionalTensor input, (int, int, int) kernelSize, (int, int, int)? stride = null, (int, int, int)? padding = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    (int, int, int) kernelSize

    The size of the kernel.

    (int, int, int)? stride

    The optional stride of the pooling. The default value is the kernel size.

    (int, int, int)? padding

    The amount of padding on the spatial dimensions of the input.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Min(FunctionalTensor, FunctionalTensor)

    Returns the element-wise minimum of input and other.

    Declaration
    public static FunctionalTensor Min(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MoveDim(FunctionalTensor, int, int)

    Returns the input tensor with a dimension moved from source to destination.

    Declaration
    public static FunctionalTensor MoveDim(this FunctionalTensor input, int source, int destination)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int source

    The dimension in the input tensor to move.

    int destination

    The moved dimension in the output tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    MoveDim(FunctionalTensor, int[], int[])

    Returns the input tensor with multiple dimensions moved from source to destination.

    Declaration
    public static FunctionalTensor MoveDim(this FunctionalTensor input, int[] source, int[] destination)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] source

    The dimensions in the input tensor to move.

    int[] destination

    The moved dimensions in the output tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Mul(FunctionalTensor, FunctionalTensor)

    Returns input * other element-wise.

    Declaration
    public static FunctionalTensor Mul(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Multinomial(FunctionalTensor, int, int?)

    Returns an output generated from the multinomial probability distribution in the corresponding row of the input.

    Declaration
    public static FunctionalTensor Multinomial(FunctionalTensor input, int numSamples, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The probability distributions.

    int numSamples

    The number of samples.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    NMS(FunctionalTensor, FunctionalTensor, float)

    Returns the indexes of the boxes with the highest scores, which pass the intersect-over-union test to other output boxes.

    Declaration
    public static FunctionalTensor NMS(FunctionalTensor boxes, FunctionalTensor scores, float iouThreshold)
    Parameters
    Type Name Description
    FunctionalTensor boxes

    The boxes tensor [N, 4] with (x1, y1, x2, y2) corners format with 0 ≤ x1 < x2 ≤ 1 and 0 ≤ y1 < y2 ≤ 1.

    FunctionalTensor scores

    The scores tensor [N].(

    float iouThreshold

    The threshold above which overlapping boxes are discarded.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Narrow(FunctionalTensor, int, int, int)

    Returns the input tensor narrowed along a dimension.

    Declaration
    public static FunctionalTensor Narrow(this FunctionalTensor input, int dim, int start, int length)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to narrow.

    int start

    The start index along the dimension.

    int length

    The number of elements along the dimension.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Narrow(FunctionalTensor, int, FunctionalTensor, FunctionalTensor)

    Returns the input tensor narrowed along a dimension.

    Declaration
    public static FunctionalTensor Narrow(this FunctionalTensor input, int dim, FunctionalTensor start, FunctionalTensor length)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to narrow.

    FunctionalTensor start

    The functional start index along the dimension.

    FunctionalTensor length

    The functional number of elements along the dimension.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Neg(FunctionalTensor)

    Returns -input element-wise.

    Declaration
    public static FunctionalTensor Neg(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    NonZero(FunctionalTensor)

    Returns the indices of the input tensor with values not equal to zero.

    Declaration
    public static FunctionalTensor NonZero(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Normal(float, float, int[], int?)

    Returns an output generated by sampling a normal distribution.

    Declaration
    public static FunctionalTensor Normal(float mean, float std, int[] size, int? seed = null)
    Parameters
    Type Name Description
    float mean

    The mean of the normal distribution.

    float std

    The standard deviation of the normal distribution.

    int[] size

    The shape of the output tensor.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    NotEqual(FunctionalTensor, FunctionalTensor)

    Returns input ≠ other element-wise.

    Declaration
    public static FunctionalTensor NotEqual(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    OneHot(FunctionalTensor, int)

    Returns a one hot tensor with given index values that has zeros everywhere except where the index of last dimension matches the corresponding value of the input tensor, in which case it will be 1.

    Declaration
    public static FunctionalTensor OneHot(FunctionalTensor tensor, int numClasses = -1)
    Parameters
    Type Name Description
    FunctionalTensor tensor

    The index tensor.

    int numClasses

    Total number of classes. If set to -1, the number of classes will be inferred as one greater than the largest class value in the input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Ones(int[], DataType)

    Returns a tensor filled with ones with a shape and a data type.

    Declaration
    public static FunctionalTensor Ones(int[] size, DataType dataType = DataType.Int)
    Parameters
    Type Name Description
    int[] size

    The shape of the tensor.

    DataType dataType

    The data type of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    OnesLike(FunctionalTensor, DataType)

    Returns a tensor filled with ones with the shape of input and a data type.

    Declaration
    public static FunctionalTensor OnesLike(FunctionalTensor input, DataType dataType = DataType.Int)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    DataType dataType

    The data type of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    PRelu(FunctionalTensor, FunctionalTensor)

    Returns PRelu(input) element-wise.

    Declaration
    public static FunctionalTensor PRelu(FunctionalTensor input, FunctionalTensor weight)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor weight

    The weight tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Pad(FunctionalTensor, int[], int)

    Returns the input tensor padded with size determined by the pad array and a constant value.

    Declaration
    public static FunctionalTensor Pad(this FunctionalTensor input, int[] pad, int value)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] pad

    The padding lower and upper sizes starting from the final dimension (pad_w_lower, pad_w_upper, pad_h_lower, pad_h_upper, ...), not all dimensions need to be padded.

    int value

    The constant value to use for padding.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Pad(FunctionalTensor, int[], float)

    Returns the input tensor padded with size determined by the pad array and a constant value.

    Declaration
    public static FunctionalTensor Pad(this FunctionalTensor input, int[] pad, float value)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] pad

    The padding lower and upper sizes starting from the final dimension (pad_w_lower, pad_w_upper, pad_h_lower, pad_h_upper, ...), not all dimensions need to be padded.

    float value

    The constant value to use for padding.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Pad(FunctionalTensor, int[], string)

    Returns the input tensor padded with size determined by the pad array and values determined by the mode.

    Declaration
    public static FunctionalTensor Pad(this FunctionalTensor input, int[] pad, string mode)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] pad

    The padding lower and upper sizes starting from the final dimension (pad_w_lower, pad_w_upper, pad_h_lower, pad_h_upper, ...), not all dimensions need to be padded.

    string mode

    The mode to use for sampling values, should be constant, reflect, replicate or circular, for constant padding with non zero values use one of the other Pad methods.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Permute(FunctionalTensor, int[])

    Returns the input tensor with permuted dimensions.

    Declaration
    public static FunctionalTensor Permute(this FunctionalTensor input, int[] dims)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dims

    The dimensions of the input tensor to use in the permuted output tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    PixelShuffle(FunctionalTensor, int)

    Returns the elements of the input tensor rearranged from a (∗,C×r^2,H,W) tensor to a (∗,C,H×r,W×r) tensor where r is the upscale factor.

    Declaration
    public static FunctionalTensor PixelShuffle(FunctionalTensor input, int upscaleFactor)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int upscaleFactor

    The upscale factor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    PixelUnshuffle(FunctionalTensor, int)

    Returns the elements of the input tensor rearranged from a (∗,C,H×r,W×r) tensor to a (∗,C×r^2,H,W) tensor where r is the downscale factor.

    Declaration
    public static FunctionalTensor PixelUnshuffle(FunctionalTensor input, int downscaleFactor)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int downscaleFactor

    The downscale factor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Positive(FunctionalTensor)

    Returns the input.

    Declaration
    public static FunctionalTensor Positive(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Pow(FunctionalTensor, float)

    Returns input^exponent element-wise.

    Declaration
    public static FunctionalTensor Pow(FunctionalTensor input, float exponent)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    float exponent

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Pow(FunctionalTensor, FunctionalTensor)

    Returns input^exponent element-wise.

    Declaration
    public static FunctionalTensor Pow(FunctionalTensor input, FunctionalTensor exponent)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor exponent

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RSqrt(FunctionalTensor)

    Returns 1/√input element-wise.

    Declaration
    public static FunctionalTensor RSqrt(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Rad2Deg(FunctionalTensor)

    Returns the input values converted from angles in radians to degrees element-wise.

    Declaration
    public static FunctionalTensor Rad2Deg(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Rand(int[], int?)

    Returns an output generated by sampling a uniform distribution on the interval [0, 1).

    Declaration
    public static FunctionalTensor Rand(int[] size, int? seed = null)
    Parameters
    Type Name Description
    int[] size

    The shape of the output tensor.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandInt(int[], int, int, int?)

    Returns an output generated by sampling a uniform distribution of integers on the interval [low, high).

    Declaration
    public static FunctionalTensor RandInt(int[] size, int low, int high, int? seed = null)
    Parameters
    Type Name Description
    int[] size

    The shape of the output tensor.

    int low

    The inclusive minimum value of the interval.

    int high

    The exclusive maximum value of the interval.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandIntLike(FunctionalTensor, int, int, int?)

    Returns an output generated by sampling a uniform distribution of integers on the interval [low, high) with shape matching the input tensor.

    Declaration
    public static FunctionalTensor RandIntLike(FunctionalTensor input, int low, int high, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int low

    The inclusive minimum value of the interval.

    int high

    The exclusive maximum value of the interval.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandLike(FunctionalTensor, int?)

    Returns an output generated by sampling a uniform distribution on the interval [0, 1) with shape matching the input tensor.

    Declaration
    public static FunctionalTensor RandLike(FunctionalTensor input, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandN(int[], int?)

    Returns an output generated by sampling a standard normal distribution.

    Declaration
    public static FunctionalTensor RandN(int[] size, int? seed = null)
    Parameters
    Type Name Description
    int[] size

    The shape of the output tensor.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandNLike(FunctionalTensor, int?)

    Returns an output generated by sampling a standard normal distribution with shape matching the input tensor.

    Declaration
    public static FunctionalTensor RandNLike(FunctionalTensor input, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandomChoice(FunctionalTensor, int?)

    Returns a randomly selected value from a 1D input tensor.

    Declaration
    public static FunctionalTensor RandomChoice(FunctionalTensor input, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor to select random values from.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    RandomChoice(FunctionalTensor, FunctionalTensor, int?)

    Returns a randomly selected value from a 1D input tensor with probabilities given by the tensor p.

    Declaration
    public static FunctionalTensor RandomChoice(FunctionalTensor input, FunctionalTensor p, int? seed = null)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor to select random values from.

    FunctionalTensor p

    The probabilities tensor corresponding to the values.

    int? seed

    The optional seed value for the random number generator.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Ravel(FunctionalTensor)

    Returns the input tensor with its elements flattened to a single dimension.

    Declaration
    public static FunctionalTensor Ravel(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Reciprocal(FunctionalTensor)

    Returns 1/input element-wise.

    Declaration
    public static FunctionalTensor Reciprocal(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceLogSumExp(FunctionalTensor, int, bool)

    Returns the log of summed exponentials of the elements of the input tensor along the dimension.

    Declaration
    public static FunctionalTensor ReduceLogSumExp(FunctionalTensor input, int dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceLogSumExp(FunctionalTensor, int[], bool)

    Returns the log of summed exponentials of the elements of the input tensor along the dimensions.

    Declaration
    public static FunctionalTensor ReduceLogSumExp(FunctionalTensor input, int[] dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions to reduce.

    bool keepdim

    Whether to keep the reduced dimensions in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceMax(FunctionalTensor, int, bool)

    Returns the maximum value of the elements of the input tensor along the dimension.

    Declaration
    public static FunctionalTensor ReduceMax(FunctionalTensor input, int dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceMax(FunctionalTensor, int[], bool)

    Returns the maximum value of the elements of the input tensor along the dimensions.

    Declaration
    public static FunctionalTensor ReduceMax(FunctionalTensor input, int[] dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions to reduce.

    bool keepdim

    Whether to keep the reduced dimensions in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceMean(FunctionalTensor, int, bool)

    Returns the mean of the elements of the input tensor along the dimension.

    Declaration
    public static FunctionalTensor ReduceMean(FunctionalTensor input, int dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceMean(FunctionalTensor, int[], bool)

    Returns the mean of the elements of the input tensor along the dimensions.

    Declaration
    public static FunctionalTensor ReduceMean(FunctionalTensor input, int[] dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions to reduce.

    bool keepdim

    Whether to keep the reduced dimensions in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceMin(FunctionalTensor, int, bool)

    Returns the minimum value of the elements of the input tensor along the dimension.

    Declaration
    public static FunctionalTensor ReduceMin(FunctionalTensor input, int dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceMin(FunctionalTensor, int[], bool)

    Returns the minimum value of the elements of the input tensor along the dimensions.

    Declaration
    public static FunctionalTensor ReduceMin(FunctionalTensor input, int[] dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions to reduce.

    bool keepdim

    Whether to keep the reduced dimensions in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceProd(FunctionalTensor, int, bool)

    Returns the product of the elements of the input tensor along the dimension.

    Declaration
    public static FunctionalTensor ReduceProd(FunctionalTensor input, int dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceProd(FunctionalTensor, int[], bool)

    Returns the product of the elements of the input tensor along the dimensions.

    Declaration
    public static FunctionalTensor ReduceProd(FunctionalTensor input, int[] dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions to reduce.

    bool keepdim

    Whether to keep the reduced dimensions in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceSum(FunctionalTensor, int, bool)

    Returns the sum of the elements of the input tensor along the dimension.

    Declaration
    public static FunctionalTensor ReduceSum(FunctionalTensor input, int dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension to reduce.

    bool keepdim

    Whether to keep the reduced dimension in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ReduceSum(FunctionalTensor, int[], bool)

    Returns the sum of the elements of the input tensor along the dimensions.

    Declaration
    public static FunctionalTensor ReduceSum(FunctionalTensor input, int[] dim, bool keepdim = false)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions to reduce.

    bool keepdim

    Whether to keep the reduced dimensions in the output.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Relu(FunctionalTensor)

    Returns relu(input) element-wise.

    Declaration
    public static FunctionalTensor Relu(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Relu6(FunctionalTensor)

    Returns relu6(input) element-wise.

    Declaration
    public static FunctionalTensor Relu6(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Remainder(FunctionalTensor, FunctionalTensor)

    Returns input % other element-wise. The sign of the output is the same as that of the divider.

    Declaration
    public static FunctionalTensor Remainder(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Reshape(FunctionalTensor, int[])

    Returns the input tensor elements reshaped.

    Declaration
    public static FunctionalTensor Reshape(this FunctionalTensor input, int[] shape)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] shape

    The shape of the output tensor. A negative value is inferred from the others.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Round(FunctionalTensor)

    Returns [input] element-wise.

    Declaration
    public static FunctionalTensor Round(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Scatter(FunctionalTensor, int, FunctionalTensor, FunctionalTensor)

    Returns a copy of the input with the elements replaced by those from source given by the index along a dimension.

    Declaration
    public static FunctionalTensor Scatter(FunctionalTensor input, int dim, FunctionalTensor index, FunctionalTensor src)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to scatter.

    FunctionalTensor index

    The index tensor.

    FunctionalTensor src

    The source tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ScatterAdd(FunctionalTensor, int, FunctionalTensor, FunctionalTensor)

    Returns a copy of the input with the elements updated by adding by those from source given by the index along a dimension.

    Declaration
    public static FunctionalTensor ScatterAdd(FunctionalTensor input, int dim, FunctionalTensor index, FunctionalTensor src)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to scatter.

    FunctionalTensor index

    The index tensor.

    FunctionalTensor src

    The source tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Select(FunctionalTensor, int, int)

    Returns the input tensor sliced along a dimension at an index.

    Declaration
    public static FunctionalTensor Select(this FunctionalTensor input, int dim, int index)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to select.

    int index

    The index along the dimension to select.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Select(FunctionalTensor, int, FunctionalTensor)

    Returns the input tensor sliced along a dimension at an index.

    Declaration
    public static FunctionalTensor Select(this FunctionalTensor input, int dim, FunctionalTensor index)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to select.

    FunctionalTensor index

    The functional index along the dimension to select.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    SelectScatter(FunctionalTensor, FunctionalTensor, int, int)

    Returns a copy of the input with the elements replaced by those from source at a dimension and index.

    Declaration
    public static FunctionalTensor SelectScatter(FunctionalTensor input, FunctionalTensor src, int dim, int index)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor src

    The source tensor.

    int dim

    The dimension along which to scatter.

    int index

    The index at which to scatter along the dimension.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Selu(FunctionalTensor)

    Returns selu(input) element-wise.

    Declaration
    public static FunctionalTensor Selu(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Sigmoid(FunctionalTensor)

    Returns sigmoid(input) element-wise.

    Declaration
    public static FunctionalTensor Sigmoid(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Sign(FunctionalTensor)

    Returns the sign of the input element-wise.

    Declaration
    public static FunctionalTensor Sign(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Sin(FunctionalTensor)

    Returns sin(input) element-wise.

    Declaration
    public static FunctionalTensor Sin(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Sinh(FunctionalTensor)

    Returns sinh(input) element-wise.

    Declaration
    public static FunctionalTensor Sinh(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    SliceScatter(FunctionalTensor, FunctionalTensor, int, int, int, int)

    Returns a copy of the input with the elements replaced by those from source along a dimension with start, end and step.

    Declaration
    public static FunctionalTensor SliceScatter(FunctionalTensor input, FunctionalTensor src, int dim = 0, int start = 0, int end = 2147483647, int step = 1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor src

    The source tensor.

    int dim

    The dimension along which to scatter.

    int start

    The index of the first element to replace along the dimension.

    int end

    The end index of the scatter along the dimension.

    int step

    The step between the indices along the dimension.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Softmax(FunctionalTensor, int)

    Returns softmax(input) element-wise along a dimension.

    Declaration
    public static FunctionalTensor Softmax(FunctionalTensor input, int dim = -1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension along which to calculate the softmax.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Softplus(FunctionalTensor)

    Returns softplus(input) element-wise.

    Declaration
    public static FunctionalTensor Softplus(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Softsign(FunctionalTensor)

    Returns softsign(input) element-wise.

    Declaration
    public static FunctionalTensor Softsign(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Split(FunctionalTensor, int[], int)

    Returns an array of tensors by splitting the input into sections along a dimension.

    Declaration
    public static FunctionalTensor[] Split(this FunctionalTensor input, int[] sections, int dim = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] sections

    The length of each section along the dimension.

    int dim

    The dimension along which to split.

    Returns
    Type Description
    FunctionalTensor[]

    The output tensor.

    Sqrt(FunctionalTensor)

    Returns √(input) element-wise.

    Declaration
    public static FunctionalTensor Sqrt(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Square(FunctionalTensor)

    Returns input*input element-wise.

    Declaration
    public static FunctionalTensor Square(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Squeeze(FunctionalTensor)

    Returns the input tensor with all dimensions of size 1 removed.

    Declaration
    public static FunctionalTensor Squeeze(this FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Squeeze(FunctionalTensor, int[])

    Returns the input tensor with all specified dimensions of size 1 removed.

    Declaration
    public static FunctionalTensor Squeeze(this FunctionalTensor input, int[] dim)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dim

    The dimensions of size 1 to remove.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Stack(FunctionalTensor[], int)

    Returns the input tensors concatenated along a new dimension.

    Declaration
    public static FunctionalTensor Stack(FunctionalTensor[] tensors, int dim = 0)
    Parameters
    Type Name Description
    FunctionalTensor[] tensors

    The input tensors.

    int dim

    The dimension along which to stack.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Sub(FunctionalTensor, FunctionalTensor)

    Returns input - other element-wise.

    Declaration
    public static FunctionalTensor Sub(FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Take(FunctionalTensor, FunctionalTensor)

    Returns a tensor with the elements of input at indices.

    Declaration
    public static FunctionalTensor Take(this FunctionalTensor input, FunctionalTensor index)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    FunctionalTensor index

    The index tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Tan(FunctionalTensor)

    Returns tan(input) element-wise.

    Declaration
    public static FunctionalTensor Tan(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Tanh(FunctionalTensor)

    Returns tanh(input) element-wise.

    Declaration
    public static FunctionalTensor Tanh(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Tensor(int)

    Returns a scalar integer tensor.

    Declaration
    public static FunctionalTensor Tensor(int value)
    Parameters
    Type Name Description
    int value

    The value of the element.

    Returns
    Type Description
    FunctionalTensor

    The tensor.

    Tensor(int[])

    Returns a 1D integer tensor.

    Declaration
    public static FunctionalTensor Tensor(int[] values)
    Parameters
    Type Name Description
    int[] values

    The values of the elements.

    Returns
    Type Description
    FunctionalTensor

    The tensor.

    Tensor(float)

    Returns a scalar float tensor.

    Declaration
    public static FunctionalTensor Tensor(float value)
    Parameters
    Type Name Description
    float value

    The value of the element.

    Returns
    Type Description
    FunctionalTensor

    The tensor.

    Tensor(float[])

    Returns a 1D float tensor.

    Declaration
    public static FunctionalTensor Tensor(float[] values)
    Parameters
    Type Name Description
    float[] values

    The values of the elements.

    Returns
    Type Description
    FunctionalTensor

    The tensor.

    Tile(FunctionalTensor, int[])

    Returns the input tensor repeated on the dims.

    Declaration
    public static FunctionalTensor Tile(this FunctionalTensor input, int[] dims)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int[] dims

    The number of times to repeat the input tensor along each dim.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    TopK(FunctionalTensor, int, int, bool, bool)

    Returns the k largest elements of the input tensor along a given dimension.

    Declaration
    public static FunctionalTensor[] TopK(FunctionalTensor input, int k, int dim = -1, bool largest = true, bool sorted = true)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int k

    The number of elements to calculate.

    int dim

    The axis along which to perform the top-K operation.

    bool largest

    Whether to calculate the top-K largest elements. If this is false the layer calculates the top-K smallest elements.

    bool sorted

    Whether to return the elements in sorted order in the output tensor.

    Returns
    Type Description
    FunctionalTensor[]

    The output values and indices tensors in an array.

    Transpose(FunctionalTensor, int, int)

    Returns the input tensor with two dimensions swapped.

    Declaration
    public static FunctionalTensor Transpose(this FunctionalTensor input, int dim0, int dim1)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim0

    The first dimension to swap.

    int dim1

    The second dimension to swap.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    TriL(FunctionalTensor, int)

    Retains the lower triangular values of an input matrix (batch). THe other values are zeroed.

    Declaration
    public static FunctionalTensor TriL(FunctionalTensor input, int diagonal = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int diagonal

    The integer offset of the diagonal.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    TriU(FunctionalTensor, int)

    Retains the upper triangular values of an input matrix (batch). THe other values are zeroed.

    Declaration
    public static FunctionalTensor TriU(FunctionalTensor input, int diagonal = 0)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int diagonal

    The integer offset of the diagonal.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Trunc(FunctionalTensor)

    Returns the truncated integer values of the elements of input element-wise.

    Declaration
    public static FunctionalTensor Trunc(FunctionalTensor input)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Type(FunctionalTensor, DataType)

    Returns the input cast to the data type element-wise.

    Declaration
    public static FunctionalTensor Type(this FunctionalTensor input, DataType dataType)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    DataType dataType

    The data type.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Unsqueeze(FunctionalTensor, int)

    Returns the input tensor with a new dimension of size 1 inserted.

    Declaration
    public static FunctionalTensor Unsqueeze(this FunctionalTensor input, int dim)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    int dim

    The dimension at which to insert a size 1 dimension in the output tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Where(FunctionalTensor, FunctionalTensor, FunctionalTensor)

    Returns condition ? input : other element-wise.

    Declaration
    public static FunctionalTensor Where(FunctionalTensor condition, FunctionalTensor input, FunctionalTensor other)
    Parameters
    Type Name Description
    FunctionalTensor condition

    The condition tensor.

    FunctionalTensor input

    The first input tensor.

    FunctionalTensor other

    The second input tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    Zeros(int[], DataType)

    Returns a tensor filled with zeros with a shape and a data type.

    Declaration
    public static FunctionalTensor Zeros(int[] size, DataType dataType = DataType.Int)
    Parameters
    Type Name Description
    int[] size

    The shape of the tensor.

    DataType dataType

    The data type of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    ZerosLike(FunctionalTensor, DataType)

    Returns a tensor filled with zeros with the shape of input and a data type.

    Declaration
    public static FunctionalTensor ZerosLike(FunctionalTensor input, DataType dataType = DataType.Int)
    Parameters
    Type Name Description
    FunctionalTensor input

    The input tensor.

    DataType dataType

    The data type of the tensor.

    Returns
    Type Description
    FunctionalTensor

    The output tensor.

    In This Article
    Back to top
    Copyright © 2024 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)