docs.unity3d.com
    Show / Hide Table of Contents

    Interface ITensorData

    An interface that represents a device-dependent representation of the data in a tensor.

    Inherited Members
    IDisposable.Dispose()
    Namespace: Unity.Sentis
    Syntax
    public interface ITensorData : IDisposable

    Properties

    deviceType

    On what device backend are the data elements stored.

    Declaration
    DeviceType deviceType { get; }
    Property Value
    Type Description
    DeviceType

    maxCapacity

    The maximum count of the stored data elements.

    Declaration
    int maxCapacity { get; }
    Property Value
    Type Description
    Int32

    Methods

    AsyncReadbackRequest(Action<Boolean>)

    Schedules asynchronous readback of the internal data.

    Invokes callback when async readback is finished.

    Boolean indicates if async readback is successful.

    Declaration
    void AsyncReadbackRequest(Action<bool> callback = null)
    Parameters
    Type Name Description
    Action<Boolean> callback

    Clone()

    Returns a deep copy of the internal storage.

    Declaration
    ITensorData Clone()
    Returns
    Type Description
    ITensorData

    CompleteAllPendingOperations()

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

    Declaration
    void CompleteAllPendingOperations()

    Download<T>(Int32, Int32)

    Returns data from internal storage.

    Declaration
    NativeArray<T> Download<T>(int dstCount, int srcOffset = 0)
        where T : struct
    Parameters
    Type Name Description
    Int32 dstCount
    Int32 srcOffset
    Returns
    Type Description
    NativeArray<T>
    Type Parameters
    Name Description
    T

    IsAsyncReadbackRequestDone()

    Checks if asynchronous readback request it done.

    Returns true if async readback is successful.

    Declaration
    bool IsAsyncReadbackRequestDone()
    Returns
    Type Description
    Boolean

    Reserve(Int32)

    Reserves memory for count elements.

    Declaration
    void Reserve(int count)
    Parameters
    Type Name Description
    Int32 count

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

    Uploads the tensor data to internal storage.

    Declaration
    void Upload<T>(NativeArray<T> data, int srcCount, int srcOffset = 0)
        where T : struct
    Parameters
    Type Name Description
    NativeArray<T> data
    Int32 srcCount
    Int32 srcOffset
    Type Parameters
    Name Description
    T
    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