docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IReadableTensorData

    An interface that represents tensor data that can be read to and written from on CPU.

    Namespace: Unity.Sentis
    Assembly: Unity.Sentis.dll
    Syntax
    public interface IReadableTensorData

    Methods

    GetReadOnlyNativeArrayHandle<T>(int)

    Returns a ReadOnlyNativeArray handle on the linear memory data.

    Declaration
    NativeArray<T>.ReadOnly GetReadOnlyNativeArrayHandle<T>(int dstCount) where T : unmanaged
    Parameters
    Type Name Description
    int dstCount

    The number of elements in the array.

    Returns
    Type Description
    NativeArray<T>.ReadOnly

    NativeArray of elements.

    Type Parameters
    Name Description
    T

    The data type of the elements.

    Get<T>(int)

    Returns a data element.

    Declaration
    T Get<T>(int index) where T : unmanaged
    Parameters
    Type Name Description
    int index

    The index of the element.

    Returns
    Type Description
    T

    Data element.

    Type Parameters
    Name Description
    T

    The data type of the element.

    Set<T>(int, T)

    Sets value data element at index.

    Declaration
    void Set<T>(int index, T value) where T : unmanaged
    Parameters
    Type Name Description
    int index

    The index of the element to set.

    T value

    The value to set for the element.

    Type Parameters
    Name Description
    T

    The data type of the element.

    ToArray<T>(int)

    Returns an array that is a copy of the linear memory data.

    Declaration
    T[] ToArray<T>(int dstCount) where T : unmanaged
    Parameters
    Type Name Description
    int dstCount

    The number of elements in the array.

    Returns
    Type Description
    T[]

    Array of elements.

    Type Parameters
    Name Description
    T

    The data type of the elements.

    ToReadOnlySpan<T>(int)

    Returns a ReadOnlySpan on the linear memory data.

    Declaration
    ReadOnlySpan<T> ToReadOnlySpan<T>(int dstCount) where T : unmanaged
    Parameters
    Type Name Description
    int dstCount

    The number of elements to span.

    Returns
    Type Description
    ReadOnlySpan<T>

    Span of elements.

    Type Parameters
    Name Description
    T

    The data type of the elements.

    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)