docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ComputeTensorData

    Represents data storage for a Tensor as a compute buffer, for GPUCompute backend.

    Inheritance
    object
    ComputeTensorData
    Implements
    ITensorData
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Sentis
    Assembly: solution.dll
    Syntax
    public class ComputeTensorData : ITensorData, IDisposable

    Constructors

    Name Description
    ComputeTensorData(TensorShape, bool)

    Initializes and returns an instance of ComputeTensorData, and allocates storage for a tensor with the shape of shape.

    ComputeTensorData(TensorShape, NativeTensorArray, int)

    Initializes and returns an instance of ComputeTensorData with given data and offset.

    Properties

    Name Description
    buffer

    The data storage as a compute buffer.

    deviceType

    On what device backend are the data elements stored.

    maxCapacity

    The maximum count of the stored data elements.

    shape

    The shape of the tensor using this data as a TensorShape.

    Methods

    Name Description
    Clone()

    Returns a deep copy of the internal storage.

    CompleteAllPendingOperations()

    Blocking call to make sure that internal data is correctly written to and available for CPU read back.

    Dispose()

    Disposes of the ComputeTensorData and any associated memory.

    Download<T>(int, int)

    Returns a contiguous block of data from internal storage.

    ~ComputeTensorData()

    Finalizes the ComputeTensorData.

    IsReadbackRequestDone()

    Checks if asynchronous readback request is done.

    Pin(Tensor, bool)

    Moves the tensor into GPU memory on the GPUCompute backend device.

    ReadbackRequest(Action<bool>)

    Schedules asynchronous readback of the internal data.

    ReadbackRequestAsync()

    Schedules awaitable asynchronous readback of the internal data.

    See AsyncReadbackRequest for more info

    Reserve(int)

    Reserves memory for count elements.

    ToString()

    Returns a string that represents the ComputeTensorData.

    Upload<T>(NativeArray<T>, int, int)

    Uploads a contiguous block of tensor data to internal storage.

    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)