Class TensorExtensions | Barracuda | 1.0.4
docs.unity3d.com
    Show / Hide Table of Contents

    Class TensorExtensions

    Inheritance
    Object
    TensorExtensions
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Barracuda
    Syntax
    public static class TensorExtensions

    Methods

    AdjustPadToKernel(Tensor, Tensor, Int32[], Int32[])

    Declaration
    public static int[] AdjustPadToKernel(this Tensor tensor, Tensor kernel, int[] stride, int[] pad)
    Parameters
    Type Name Description
    Tensor tensor
    Tensor kernel
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    Int32[]

    AdjustPadToKernel(TensorShape, TensorShape, Int32[], Int32[])

    Declaration
    public static int[] AdjustPadToKernel(this TensorShape shape, TensorShape kernel, int[] stride, int[] pad)
    Parameters
    Type Name Description
    TensorShape shape
    TensorShape kernel
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    Int32[]

    AdjustPadToPool(Tensor, Int32[], Int32[], Int32[])

    Declaration
    public static int[] AdjustPadToPool(this Tensor tensor, int[] pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    Tensor tensor
    Int32[] pool
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    Int32[]

    AdjustPadToPool(Tensor, ValueTuple<Int32, Int32>, Int32[], Int32[])

    Declaration
    public static int[] AdjustPadToPool(this Tensor tensor, ValueTuple<int, int> pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    Tensor tensor
    ValueTuple<Int32, Int32> pool
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    Int32[]

    AdjustPadToPool(TensorShape, Int32[], Int32[], Int32[])

    Declaration
    public static int[] AdjustPadToPool(this TensorShape shape, int[] pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    TensorShape shape
    Int32[] pool
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    Int32[]

    AdjustPadToPool(TensorShape, ValueTuple<Int32, Int32>, Int32[], Int32[])

    Declaration
    public static int[] AdjustPadToPool(this TensorShape shape, ValueTuple<int, int> pool, int[] stride, int[] pad)
    Parameters
    Type Name Description
    TensorShape shape
    ValueTuple<Int32, Int32> pool
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    Int32[]

    ApplyBorder(TensorShape, Int32[])

    Declaration
    public static TensorShape ApplyBorder(this TensorShape shape, int[] border)
    Parameters
    Type Name Description
    TensorShape shape
    Int32[] border
    Returns
    Type Description
    TensorShape

    ApplyKernel(TensorShape, TensorShape, Int32[], Int32[])

    Declaration
    public static TensorShape ApplyKernel(this TensorShape shape, TensorShape kernel, int[] stride, int[] pad)
    Parameters
    Type Name Description
    TensorShape shape
    TensorShape kernel
    Int32[] stride
    Int32[] pad
    Returns
    Type Description
    TensorShape

    ApplyKernelInverse(TensorShape, TensorShape, Int32[], Int32[], Int32[])

    Declaration
    public static TensorShape ApplyKernelInverse(this TensorShape shape, TensorShape kernel, int[] stride, int[] pad, int[] outputAdjustment)
    Parameters
    Type Name Description
    TensorShape shape
    TensorShape kernel
    Int32[] stride
    Int32[] pad
    Int32[] outputAdjustment
    Returns
    Type Description
    TensorShape

    ApplyPool(TensorShape, Int32[], Int32[], Int32[], Boolean)

    Declaration
    public static TensorShape ApplyPool(this TensorShape shape, int[] pool, int[] stride, int[] pad, bool ceilMode = false)
    Parameters
    Type Name Description
    TensorShape shape
    Int32[] pool
    Int32[] stride
    Int32[] pad
    Boolean ceilMode
    Returns
    Type Description
    TensorShape

    ApplyPool(TensorShape, ValueTuple<Int32, Int32>, Int32[], Int32[], Boolean)

    Declaration
    public static TensorShape ApplyPool(this TensorShape shape, ValueTuple<int, int> pool, int[] stride, int[] pad, bool ceilMode = false)
    Parameters
    Type Name Description
    TensorShape shape
    ValueTuple<Int32, Int32> pool
    Int32[] stride
    Int32[] pad
    Boolean ceilMode
    Returns
    Type Description
    TensorShape

    ApplyStridedSlice(TensorShape, Int32[], Int32[], Int32[])

    Declaration
    public static TensorShape ApplyStridedSlice(this TensorShape shape, int[] starts, int[] ends, int[] stride)
    Parameters
    Type Name Description
    TensorShape shape
    Int32[] starts
    Int32[] ends
    Int32[] stride
    Returns
    Type Description
    TensorShape

    Approximately(Tensor, Tensor, Single, Int32)

    Declaration
    public static bool Approximately(this Tensor X, Tensor Y, float epsilon = 0.0001F, int count = -1)
    Parameters
    Type Name Description
    Tensor X
    Tensor Y
    Single epsilon
    Int32 count
    Returns
    Type Description
    Boolean

    ArgMax(Tensor)

    Declaration
    public static int[] ArgMax(this Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Int32[]

    ArgSort(Tensor)

    Declaration
    public static int[][] ArgSort(this Tensor X)
    Parameters
    Type Name Description
    Tensor X
    Returns
    Type Description
    Int32[][]

    AsFloats(Tensor)

    Declaration
    public static float[] AsFloats(this Tensor x)
    Parameters
    Type Name Description
    Tensor x
    Returns
    Type Description
    Single[]

    AsInts(Tensor)

    Declaration
    public static int[] AsInts(this Tensor x)
    Parameters
    Type Name Description
    Tensor x
    Returns
    Type Description
    Int32[]

    AsLongs(Tensor)

    Declaration
    public static long[] AsLongs(this Tensor x)
    Parameters
    Type Name Description
    Tensor x
    Returns
    Type Description
    Int64[]

    Concat(Tensor[], Int32)

    Declaration
    public static TensorShape Concat(Tensor[] tensors, int axis)
    Parameters
    Type Name Description
    Tensor[] tensors
    Int32 axis
    Returns
    Type Description
    TensorShape

    Concat(TensorShape[], Int32)

    Declaration
    public static TensorShape Concat(TensorShape[] shapes, int axis)
    Parameters
    Type Name Description
    TensorShape[] shapes
    Int32 axis
    Returns
    Type Description
    TensorShape

    CreateFromTexture(Texture, TensorShape)

    Declaration
    public static ITensorData CreateFromTexture(Texture tex, TensorShape shape)
    Parameters
    Type Name Description
    Texture tex
    TensorShape shape
    Returns
    Type Description
    ITensorData

    DataToString(Tensor, Int32)

    Declaration
    public static string DataToString(this Tensor X, int size = 32)
    Parameters
    Type Name Description
    Tensor X
    Int32 size
    Returns
    Type Description
    String

    Equals(Tensor, Tensor)

    Declaration
    public static bool Equals(this Tensor X, Tensor Y)
    Parameters
    Type Name Description
    Tensor X
    Tensor Y
    Returns
    Type Description
    Boolean

    Gather(TensorShape[], Int32)

    Declaration
    public static TensorShape Gather(TensorShape[] shapes, int axis)
    Parameters
    Type Name Description
    TensorShape[] shapes
    Int32 axis
    Returns
    Type Description
    TensorShape

    Max(TensorShape[])

    Declaration
    public static TensorShape Max(TensorShape[] shapes)
    Parameters
    Type Name Description
    TensorShape[] shapes
    Returns
    Type Description
    TensorShape

    MaxDifference(Tensor, Tensor)

    Declaration
    public static float MaxDifference(this Tensor X, Tensor Y)
    Parameters
    Type Name Description
    Tensor X
    Tensor Y
    Returns
    Type Description
    Single

    MaxShape(Tensor[])

    Declaration
    public static TensorShape MaxShape(Tensor[] tensors)
    Parameters
    Type Name Description
    Tensor[] tensors
    Returns
    Type Description
    TensorShape

    Print(Tensor, String)

    Declaration
    public static void Print(this Tensor X, string msg = "")
    Parameters
    Type Name Description
    Tensor X
    String msg

    PrintDataPart(Tensor, Int32, String)

    Declaration
    public static void PrintDataPart(this Tensor X, int size, string msg = "")
    Parameters
    Type Name Description
    Tensor X
    Int32 size
    String msg

    Reduce(TensorShape, Int32)

    Declaration
    public static TensorShape Reduce(this TensorShape shape, int axis)
    Parameters
    Type Name Description
    TensorShape shape
    Int32 axis
    Returns
    Type Description
    TensorShape

    Reshape(Tensor, Int32[])

    Declaration
    public static Tensor Reshape(this Tensor X, int[] size)
    Parameters
    Type Name Description
    Tensor X
    Int32[] size
    Returns
    Type Description
    Tensor

    Reshape(TensorShape, Int32[])

    Declaration
    public static TensorShape Reshape(this TensorShape shape, int[] size)
    Parameters
    Type Name Description
    TensorShape shape
    Int32[] size
    Returns
    Type Description
    TensorShape

    Scale(TensorShape, Int32[])

    Declaration
    public static TensorShape Scale(this TensorShape shape, int[] scale)
    Parameters
    Type Name Description
    TensorShape shape
    Int32[] scale
    Returns
    Type Description
    TensorShape

    Scale(TensorShape, TensorShape)

    Declaration
    public static TensorShape Scale(this TensorShape shape, TensorShape scale)
    Parameters
    Type Name Description
    TensorShape shape
    TensorShape scale
    Returns
    Type Description
    TensorShape

    TestInit(Tensor, Int32)

    Declaration
    public static void TestInit(this Tensor X, int n = -1)
    Parameters
    Type Name Description
    Tensor X
    Int32 n

    TestInitCos(Tensor, Int32, Single)

    Declaration
    public static void TestInitCos(this Tensor X, int n = -1, float offset = 0F)
    Parameters
    Type Name Description
    Tensor X
    Int32 n
    Single offset

    TestInitValue(Tensor, Single, Int32)

    Declaration
    public static void TestInitValue(this Tensor X, float value = 0.1F, int n = -1)
    Parameters
    Type Name Description
    Tensor X
    Single value
    Int32 n

    WrapIndex(Int32, Int32)

    Declaration
    public static int WrapIndex(int i, int length)
    Parameters
    Type Name Description
    Int32 i
    Int32 length
    Returns
    Type Description
    Int32
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023