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

    Class Tensor

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

    Constructors

    Tensor(Int32, Int32, Int32, Int32, Single[], String)

    Create a Tensor of shape [N,H,W,C], an array of data srcData and an optional debug name. srcData must be of size n*h*w*c.

    Declaration
    public Tensor(int n, int h, int w, int c, float[] srcData, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    Single[] srcData
    String name

    Tensor(Int32, Int32, Int32, Int32, Single[][], String)

    Create a Tensor of shape [N,H,W,C], an array of data srcData and an optional debug name. srcData must be of size n*h*w*c.

    Declaration
    public Tensor(int n, int h, int w, int c, float[][] srcData, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    Single[][] srcData
    String name

    Tensor(Int32, Int32, Int32, Int32, String)

    Create an uninitialized Tensor of shape [N,H,W,C] and an optional debug name.

    Declaration
    public Tensor(int n, int h, int w, int c, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    String name

    Tensor(Int32, Int32, Int32, Int32, ITensorAllocator)

    Create an uninitialized Tensor of shape [N,H,W,C] and an ITensorAllocator allocator.

    Declaration
    public Tensor(int n, int h, int w, int c, ITensorAllocator allocator)
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    ITensorAllocator allocator

    Tensor(Int32, Int32, Int32, Int32, ITensorData, String)

    Create a Tensor of shape [N,H,W,C], an ITensorData data and an optional debug name. srcData must be of size n*h*w*c.

    Declaration
    public Tensor(int n, int h, int w, int c, ITensorData data, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    ITensorData data
    String name

    Tensor(Int32, Int32, Int32, Int32, ITensorData, ITensorAllocator)

    Create a Tensor of shape [N,H,W,C], an ITensorData data and an ITensorAllocator allocator. data must be of size n*h*w*c.

    Declaration
    public Tensor(int n, int h, int w, int c, ITensorData data, ITensorAllocator allocator)
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    ITensorData data
    ITensorAllocator allocator

    Tensor(Int32, Int32, Int32, Int32, ComputeBuffer, String)

    Create a Tensor of shape [N,H,W,C], associated ComputeBuffer srcBuffer filled with tensor values, and an optional debug name. srcBuffer must be larger than n*h*w*c.

    Declaration
    public Tensor(int n, int h, int w, int c, ComputeBuffer srcBuffer, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 h
    Int32 w
    Int32 c
    ComputeBuffer srcBuffer
    String name

    Tensor(Int32, Int32, Single[], String)

    Create a Tensor of shape [N,1,1,C], an array of data srcData and an optional debug name. srcData must be of size n*c.

    Declaration
    public Tensor(int n, int c, float[] srcData, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    Single[] srcData
    String name

    Tensor(Int32, Int32, Single[][], String)

    Create a Tensor of shape [N,1,1,C], an array of data srcData and an optional debug name. srcData must be of size n*c.

    Declaration
    public Tensor(int n, int c, float[][] srcData, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    Single[][] srcData
    String name

    Tensor(Int32, Int32, String)

    Create an uninitialized Tensor of shape [N,1,1,C] and an optional debug name.

    Declaration
    public Tensor(int n, int c, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    String name

    Tensor(Int32, Int32, ITensorAllocator)

    Create an uninitialized Tensor of shape [N,1,1,C] and an ITensorAllocator allocator.

    Declaration
    public Tensor(int n, int c, ITensorAllocator allocator)
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    ITensorAllocator allocator

    Tensor(Int32, Int32, ITensorData, String)

    Create a Tensor of shape [N,1,1,C], an ITensorData data and an optional debug name. srcData must be of size n*c.

    Declaration
    public Tensor(int n, int c, ITensorData data, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    ITensorData data
    String name

    Tensor(Int32, Int32, ITensorData, ITensorAllocator)

    Create a Tensor of shape [N,1,1,C], an ITensorData data and an ITensorAllocator allocator. srcData must be of size n*c.

    Declaration
    public Tensor(int n, int c, ITensorData data, ITensorAllocator allocator)
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    ITensorData data
    ITensorAllocator allocator

    Tensor(Int32, Int32, ComputeBuffer, String)

    Create a Tensor of shape [N,1,1,C], associated ComputeBuffer srcBuffer filled with tensor values, and an optional debug name. srcBuffer must be larger than n*c.

    Declaration
    public Tensor(int n, int c, ComputeBuffer srcBuffer, string name = "")
    Parameters
    Type Name Description
    Int32 n
    Int32 c
    ComputeBuffer srcBuffer
    String name

    Tensor(Int32[], Single[], String)

    Create a Tensor from a shape, an array of data srcData and an optional debug name. shape must be of size 4, the order is [N,H,W,C]. srcData must be of size s[0]*s[1]*s[2]*s[3].

    Declaration
    public Tensor(int[] shape, float[] srcData, string name = "")
    Parameters
    Type Name Description
    Int32[] shape
    Single[] srcData
    String name

    Tensor(Int32[], Single[][], String)

    Create a Tensor from a shape, an array of data srcData and an optional name debug name. shape must be of size 4, the order is [N,H,W,C]. srcData must be of size s[0]*s[1]*s[2]*s[3].

    Declaration
    public Tensor(int[] shape, float[][] srcData, string name = "")
    Parameters
    Type Name Description
    Int32[] shape
    Single[][] srcData
    String name

    Tensor(Int32[], String)

    Create an uninitialized Tensor from a shape and an optional debug name. shape must be of size 4, the order is [N,H,W,C]

    Declaration
    public Tensor(int[] shape, string name = "")
    Parameters
    Type Name Description
    Int32[] shape
    String name

    Tensor(Int32[], ITensorAllocator)

    Create an uninitialized Tensor from a shape and an ITensorAllocator allocator. shape must be of size 4, the order is [N,H,W,C].

    Declaration
    public Tensor(int[] shape, ITensorAllocator allocator)
    Parameters
    Type Name Description
    Int32[] shape
    ITensorAllocator allocator

    Tensor(Int32[], ITensorData, String)

    Create a Tensor from a shape, an ITensorData data and an optional debug name. shape must be of size 4, the order is [N,H,W,C].

    Declaration
    public Tensor(int[] shape, ITensorData data, string name = "")
    Parameters
    Type Name Description
    Int32[] shape
    ITensorData data
    String name

    Tensor(Int32[], ITensorData, ITensorAllocator)

    Create a Tensor from a shape, an ITensorData data and an ITensorAllocator allocator. shape must be of size 4, the order is [N,H,W,C].

    Declaration
    public Tensor(int[] shape, ITensorData data, ITensorAllocator allocator)
    Parameters
    Type Name Description
    Int32[] shape
    ITensorData data
    ITensorAllocator allocator

    Tensor(Int32[], ComputeBuffer, String)

    Create a Tensor from a shape, associated ComputeBuffer srcBuffer filled with tensor values, and an optional debug name. shape must be of size 4, the order is [N,H,W,C]. srcBuffer must be larger than s[0]*s[1]*s[2]*s[3].

    Declaration
    public Tensor(int[] shape, ComputeBuffer srcBuffer, string name = "")
    Parameters
    Type Name Description
    Int32[] shape
    ComputeBuffer srcBuffer
    String name

    Tensor(String)

    Create an uninitialized Tensor with a shape of [1,1,1,1] and an optional debug name.

    Declaration
    public Tensor(string name = "")
    Parameters
    Type Name Description
    String name

    Tensor(ITensorAllocator)

    Create an uninitialized Tensor with a shape of [1,1,1,1] and an ITensorAllocator allocator.

    Declaration
    public Tensor(ITensorAllocator allocator)
    Parameters
    Type Name Description
    ITensorAllocator allocator

    Tensor(TensorShape, Single[], String)

    Create a Tensor with specified shape, an array of data srcData and an optional debug name. srcData must be of size shape.length.

    Declaration
    public Tensor(TensorShape shape, float[] srcData, string name = "")
    Parameters
    Type Name Description
    TensorShape shape
    Single[] srcData
    String name

    Tensor(TensorShape, Single[][], String)

    Create a Tensor with specified shape, an array of data srcData and an optional debug name. srcData must be of size shape.length.

    Declaration
    public Tensor(TensorShape shape, float[][] srcData, string name = "")
    Parameters
    Type Name Description
    TensorShape shape
    Single[][] srcData
    String name

    Tensor(TensorShape, String)

    Create an uninitialized Tensor with specified shape and an optional debug name.

    Declaration
    public Tensor(TensorShape shape, string name = "")
    Parameters
    Type Name Description
    TensorShape shape
    String name

    Tensor(TensorShape, ITensorAllocator)

    Create an uninitialized Tensor with specified shape and ITensorAllocator allocator.

    Declaration
    public Tensor(TensorShape shape, ITensorAllocator allocator)
    Parameters
    Type Name Description
    TensorShape shape
    ITensorAllocator allocator

    Tensor(TensorShape, ITensorData, String)

    Create a Tensor with specified shape, an ITensorData data and an optional debug name.

    Declaration
    public Tensor(TensorShape shape, ITensorData data, string name = "")
    Parameters
    Type Name Description
    TensorShape shape
    ITensorData data
    String name

    Tensor(TensorShape, ITensorData, ITensorAllocator)

    Create a Tensor with specified shape, an ITensorData data and an ITensorAllocator allocator

    Declaration
    public Tensor(TensorShape shape, ITensorData data, ITensorAllocator allocator)
    Parameters
    Type Name Description
    TensorShape shape
    ITensorData data
    ITensorAllocator allocator

    Tensor(TensorShape, ComputeBuffer, String)

    Create a Tensor with specified shape, associated ComputeBuffer srcBuffer filled with tensor values, and an optional debug name. srcBuffer must be larger than shape.length.

    Declaration
    public Tensor(TensorShape shape, ComputeBuffer srcBuffer, string name = "")
    Parameters
    Type Name Description
    TensorShape shape
    ComputeBuffer srcBuffer
    String name

    Tensor(Texture, Int32, String)

    Create a Tensor from a texture, shape is [1, texture.height, texture.width, channels]. If channels is set to -1 (default value), then number of channels in the new Tensor will match the number of channels in the texture. Just like Texture2D.GetPixels when reading from LDR texture (RGBA32, ARGB32, RGB24, Alpha8, RG16, R8, etc) this function will remap pixel values from byte values to the range of [0.0 .. 1.0]. Pixel values from HDR textures (such as ARGBFloat or ARGBHalf) will be left unchanged.

    Declaration
    public Tensor(Texture srcTexture, int channels = -1, string name = "")
    Parameters
    Type Name Description
    Texture srcTexture
    Int32 channels
    String name

    Tensor(Texture[], Int32, String)

    Create a Tensor from multiple texture, shape is [srcTextures.length, texture.height, texture.width, channels]. If channels is set to -1 (default value), then number of channels in the new Tensor will match the number of channels in the texture. All textures must be of the same size and dimension. Just like Texture2D.GetPixels when reading from LDR texture (RGBA32, ARGB32, RGB24, Alpha8, RG16, R8, etc) this function will remap pixel values from byte values to the range of [0.0 .. 1.0]. Pixel values from HDR textures (such as ARGBFloat or ARGBHalf) will be left unchanged.

    Declaration
    public Tensor(Texture[] srcTextures, int channels = -1, string name = "")
    Parameters
    Type Name Description
    Texture[] srcTextures
    Int32 channels
    String name

    Fields

    name

    Return this tensor name.

    Declaration
    public string name
    Field Value
    Type Description
    String

    shape

    Return this tensor shape as [N,H,W,C].

    Declaration
    public readonly TensorShape shape
    Field Value
    Type Description
    TensorShape

    Properties

    allocator

    Return this tensor allocator, see interface ITensorAllocator.

    Declaration
    public ITensorAllocator allocator { get; }
    Property Value
    Type Description
    ITensorAllocator

    batch

    Return the number of batch.

    Declaration
    public int batch { get; }
    Property Value
    Type Description
    Int32

    channels

    Return the number of channels.

    Declaration
    public int channels { get; }
    Property Value
    Type Description
    Int32

    data

    Declaration
    public ITensorData data { get; }
    Property Value
    Type Description
    ITensorData

    dimensions

    Return the count of non-unit dimension of this tensor shape. For example [N,1,1,C] dimensions is 2.

    Declaration
    public int dimensions { get; }
    Property Value
    Type Description
    Int32

    flatHeight

    Return the number of batch.

    Declaration
    public int flatHeight { get; }
    Property Value
    Type Description
    Int32

    flatWidth

    Return the HWC.

    Declaration
    public int flatWidth { get; }
    Property Value
    Type Description
    Int32

    height

    Return the spatial height.

    Declaration
    public int height { get; }
    Property Value
    Type Description
    Int32

    Item[Int32]

    Access element at offset index in this Tensor. This will create a blocking read, if this Tensor is a result of a computation on a different device (GPU).

    Declaration
    public float this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index
    Property Value
    Type Description
    Single

    Item[Int32, Int32]

    Access element at index [N,0,0,C] in this Tensor. This will create a blocking read, if this Tensor is a result of a computation on a different device (GPU).

    Declaration
    public float this[int b, int ch] { get; set; }
    Parameters
    Type Name Description
    Int32 b
    Int32 ch
    Property Value
    Type Description
    Single

    Item[Int32, Int32, Int32, Int32]

    Access element at index [N,H,W,C] in this Tensor. This will create a blocking read, if this Tensor is a result of a computation on a different device (GPU).

    Declaration
    public float this[int b, int h, int w, int ch] { get; set; }
    Parameters
    Type Name Description
    Int32 b
    Int32 h
    Int32 w
    Int32 ch
    Property Value
    Type Description
    Single

    kernelCount

    Kernel dimension ordering is [H,W,C,K] for efficiency purpose. Return kernel count (aka the number of output channels of the associated operator).

    Declaration
    public int kernelCount { get; }
    Property Value
    Type Description
    Int32

    kernelDepth

    Kernel dimension ordering is [H,W,C,K] for efficiency purpose. Return kernel depth (aka the number of input channels of the associated operator).

    Declaration
    public int kernelDepth { get; }
    Property Value
    Type Description
    Int32

    kernelHeight

    Kernel dimension ordering is [H,W,C,K] for efficiency purpose. Return kernel height.

    Declaration
    public int kernelHeight { get; }
    Property Value
    Type Description
    Int32

    kernelWidth

    Kernel dimension ordering is [H,W,C,K] for efficiency purpose. Return kernel width.

    Declaration
    public int kernelWidth { get; }
    Property Value
    Type Description
    Int32

    length

    Return the total number of elements in this tensor.

    Declaration
    public int length { get; }
    Property Value
    Type Description
    Int32

    readonlyArray

    Declaration
    [Obsolete("Use ToReadOnlyArray instead.", false)]
    public float[] readonlyArray { get; }
    Property Value
    Type Description
    Single[]

    readonlyArrayOffset

    Declaration
    [Obsolete("Use ToReadOnlyArray instead.", false)]
    public int readonlyArrayOffset { get; }
    Property Value
    Type Description
    Int32

    tensorOnDevice

    Declaration
    public ITensorData tensorOnDevice { get; }
    Property Value
    Type Description
    ITensorData

    width

    Return the spatial width.

    Declaration
    public int width { get; }
    Property Value
    Type Description
    Int32

    Methods

    AttachToDevice(ITensorData)

    Associates tensor with the block of data residing on a device. Tensor values will be downloaded from the source upon the first access. source should contain initialized and valid data representing tensor values. See also PrepareCacheForAccess() to schedule download as soon as possible.

    Declaration
    public void AttachToDevice(ITensorData source)
    Parameters
    Type Name Description
    ITensorData source

    Axis(Int32)

    Allow to use negative axis to access tensorShape backward. axis should be from -rank to rank (exclusive).

    Declaration
    public int Axis(int axis)
    Parameters
    Type Name Description
    Int32 axis
    Returns
    Type Description
    Int32

    DeepCopy()

    Create a copy of the current Tensor.

    Declaration
    public Tensor DeepCopy()
    Returns
    Type Description
    Tensor

    DetachFromDevice(Boolean)

    Remove tensor from device, will first sync the cache with device data.

    Declaration
    public ITensorData DetachFromDevice(bool disposeDeviceData = true)
    Parameters
    Type Name Description
    Boolean disposeDeviceData
    Returns
    Type Description
    ITensorData

    Dispose()

    Dispose Tensor and associated memories.

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

    Finalize()

    Destructor will also dispose associated memories.

    Declaration
    protected void Finalize()

    Flatten(String)

    Create a flattened copy of the current Tensor ie of shape [N,1,1,HWC]

    Declaration
    public Tensor Flatten(string newName = null)
    Parameters
    Type Name Description
    String newName
    Returns
    Type Description
    Tensor

    FlushCache()

    Upload cache to device memory and delete it.

    Declaration
    public void FlushCache()

    Index(Int32, Int32)

    Given an element dimensions indices [N,0,0,C] return this element offset in memory.

    Declaration
    public int Index(int y, int x)
    Parameters
    Type Name Description
    Int32 y
    Int32 x
    Returns
    Type Description
    Int32

    Index(Int32, Int32, Int32, Int32)

    Given an element dimensions indices [N,H,W,C] return this element offset in memory.

    Declaration
    public int Index(int b, int h, int w, int ch)
    Parameters
    Type Name Description
    Int32 b
    Int32 h
    Int32 w
    Int32 ch
    Returns
    Type Description
    Int32

    IndexWithBroadcast(Int32, Int32, Int32, Int32)

    Given an element dimensions indices [N,H,W,C] with broadcast support, return this element offset in memory.

    Declaration
    public int IndexWithBroadcast(int b, int h, int w, int ch)
    Parameters
    Type Name Description
    Int32 b
    Int32 h
    Int32 w
    Int32 ch
    Returns
    Type Description
    Int32

    IndexWithClamp(Int32, Int32, Int32, Int32)

    Given an element dimensions indices [N,H,W,C] return this element offset in memory, clamping indices to tensor dimensions.

    Declaration
    public int IndexWithClamp(int b, int h, int w, int ch)
    Parameters
    Type Name Description
    Int32 b
    Int32 h
    Int32 w
    Int32 ch
    Returns
    Type Description
    Int32

    PrepareCacheForAccess(Boolean)

    Populate the cache with on device data. Blocking read if blocking is true (default)

    Declaration
    public bool PrepareCacheForAccess(bool blocking = true)
    Parameters
    Type Name Description
    Boolean blocking
    Returns
    Type Description
    Boolean

    Reshape(TensorShape, String)

    Create a reshaped copy of the current Tensor. newShape.length must be equal to this.shape.length.

    Declaration
    public Tensor Reshape(TensorShape newShape, string newName = null)
    Parameters
    Type Name Description
    TensorShape newShape
    String newName
    Returns
    Type Description
    Tensor

    ShallowCopy(String)

    Create a copy of the current Tensor, sharing data storage with original tensor.

    Declaration
    public Tensor ShallowCopy(string newName = null)
    Parameters
    Type Name Description
    String newName
    Returns
    Type Description
    Tensor

    TakeOwnership()

    Remove system reference to this tensor, caller assume ownership.

    Declaration
    public void TakeOwnership()

    ToReadOnlyArray()

    Return the cached linear memory representation of this tensor data. This will create a blocking read, if this Tensor is a result of a computation on a different device (GPU). IMPORTANT: Modifying contents of the returned array will have undefined behavior.

    Declaration
    public float[] ToReadOnlyArray()
    Returns
    Type Description
    Single[]

    ToRenderTexture(Int32, Int32, Single, Single, Texture3D)

    Create new RenderTexture and fill it with a portion of the tensor applying scale and bias. Portion of the target is specified by batch and fromChannel. batch specifies the tensor batch to read values from. fromChannel specifies the first tensor channel to start reading values from. Number of channels in the target texture specifies how many channels to read from the tensor, starting from index fromChannel. Resolution of the target must match the spatial dimensions of the tensor. scale multiplier and bias addition is applied to the values read from the tensor and clamped to the range from 0.0 to 1.0.

    Declaration
    public RenderTexture ToRenderTexture(int batch = 0, int fromChannel = 0, float scale = 1F, float bias = 0F, Texture3D lut = null)
    Parameters
    Type Name Description
    Int32 batch
    Int32 fromChannel
    Single scale
    Single bias
    Texture3D lut
    Returns
    Type Description
    RenderTexture

    ToRenderTexture(RenderTexture, Int32, Int32, Single, Single, Texture3D)

    Fill a target RenderTexture with a portion of the tensor applying scale and bias. Portion of the target is specified by batch and fromChannel. batch specifies the tensor batch to read values from. fromChannel specifies the first tensor channel to start reading values from. Number of channels in the target texture specifies how many channels to read from the tensor, starting from index fromChannel. Resolution of the target must match the spatial dimensions of the tensor. scale multiplier and bias addition is applied to the values read from the tensor and, if target is LDR texture (RGBA32, ARGB32, RGB24, Alpha8, RG16, R8, etc), clamped to the range from 0.0 to 1.0.

    Declaration
    public void ToRenderTexture(RenderTexture target, int batch = 0, int fromChannel = 0, float scale = 1F, float bias = 0F, Texture3D lut = null)
    Parameters
    Type Name Description
    RenderTexture target
    Int32 batch
    Int32 fromChannel
    Single scale
    Single bias
    Texture3D lut

    ToRenderTexture(RenderTexture, Int32, Int32, Vector4, Vector4, Texture3D)

    Fill a target RenderTexture with a portion of the tensor applying scale and bias. Portion of the target is specified by batch and fromChannel. batch specifies the tensor batch to read values from. fromChannel specifies the first tensor channel to start reading values from. Number of channels in the target texture specifies how many channels to read from the tensor, starting from index fromChannel. Resolution of the target must match the spatial dimensions of the tensor. scale multiplier and bias addition is applied to the values read from the tensor and, if target is LDR texture (RGBA32, ARGB32, RGB24, Alpha8, RG16, R8, etc), clamped to the range from 0.0 to 1.0.

    Declaration
    public void ToRenderTexture(RenderTexture target, int batch, int fromChannel, Vector4 scale, Vector4 bias, Texture3D lut = null)
    Parameters
    Type Name Description
    RenderTexture target
    Int32 batch
    Int32 fromChannel
    Vector4 scale
    Vector4 bias
    Texture3D lut

    ToRenderTexture(RenderTextureFormat, Int32, Int32, Single, Single, Texture3D)

    Create new RenderTexture and fill it with a portion of the tensor applying scale and bias. Portion of the target is specified by batch and fromChannel. format specifies the type of the new RenderTexture. batch specifies the tensor batch to read values from. fromChannel specifies the first tensor channel to start reading values from. Number of channels in the target texture specifies how many channels to read from the tensor, starting from index fromChannel. scale multiplier and bias addition is applied to the values read from the tensor and, if format is LDR (RGBA32, ARGB32, RGB24, Alpha8, RG16, R8, etc), clamped to the range from 0.0 to 1.0.

    Declaration
    public RenderTexture ToRenderTexture(RenderTextureFormat format, int batch = 0, int fromChannel = 0, float scale = 1F, float bias = 0F, Texture3D lut = null)
    Parameters
    Type Name Description
    RenderTextureFormat format
    Int32 batch
    Int32 fromChannel
    Single scale
    Single bias
    Texture3D lut
    Returns
    Type Description
    RenderTexture

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    Object.ToString()

    UnpinAndDisposeTensor()

    Declaration
    [Obsolete("Use Dispose instead.", false)]
    public ITensorData UnpinAndDisposeTensor()
    Returns
    Type Description
    ITensorData

    UploadToDevice(ITensorData, Boolean)

    Upload tensor values to the device. This call associates tensor with the uninitialized block of data residing on a device. destination should be allocated on a target device. Previous contents of destination will be overwritten after this call. By default local cache will be discarded after this call, set invalidateCacheAfterUpload to false to keep the cache.

    Declaration
    public void UploadToDevice(ITensorData destination, bool invalidateCacheAfterUpload = true)
    Parameters
    Type Name Description
    ITensorData destination
    Boolean invalidateCacheAfterUpload

    Extension Methods

    DeprecatedTensorExtensions.PinToDeviceAndUploadToIt(Tensor, ITensorData, Boolean)
    DeprecatedTensorExtensions.PinToDeviceAndDownloadFromIt(Tensor, ITensorData)
    DeprecatedTensorExtensions.Unpin(Tensor, Boolean)
    DeprecatedTensorExtensions.CastOnDevice(Tensor, ITensorData)
    TensorExtensions.TestInit(Tensor, Int32)
    TensorExtensions.TestInitCos(Tensor, Int32, Single)
    TensorExtensions.TestInitValue(Tensor, Single, Int32)
    TensorExtensions.AsFloats(Tensor)
    TensorExtensions.AsInts(Tensor)
    TensorExtensions.AsLongs(Tensor)
    TensorExtensions.DataToString(Tensor, Int32)
    TensorExtensions.Print(Tensor, String)
    TensorExtensions.PrintDataPart(Tensor, Int32, String)
    TensorExtensions.Equals(Tensor, Tensor)
    TensorExtensions.Approximately(Tensor, Tensor, Single, Int32)
    TensorExtensions.MaxDifference(Tensor, Tensor)
    TensorExtensions.ArgMax(Tensor)
    TensorExtensions.Reshape(Tensor, Int32[])
    TensorExtensions.ArgSort(Tensor)
    TensorExtensions.AdjustPadToKernel(Tensor, Tensor, Int32[], Int32[])
    TensorExtensions.AdjustPadToPool(Tensor, Int32[], Int32[], Int32[])
    TensorExtensions.AdjustPadToPool(Tensor, ValueTuple<Int32, Int32>, Int32[], Int32[])
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 20 October 2020