docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor ArrayTensorData

    ArrayTensorData(TensorShape, bool)

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

    Declaration
    public ArrayTensorData(TensorShape shape, bool clearOnInit = false)
    Parameters
    Type Name Description
    TensorShape shape

    The shape of the tensor data to allocate.

    bool clearOnInit

    Whether to zero the data on allocation. The default value is false.

    ArrayTensorData(TensorShape, NativeTensorArray, int, bool)

    Initializes and returns an instance of ArrayTensorData with given storage and offset.

    Declaration
    public ArrayTensorData(TensorShape shape, NativeTensorArray data, int offset = 0, bool clearOnInit = false)
    Parameters
    Type Name Description
    TensorShape shape

    The shape of the tensor data.

    NativeTensorArray data

    The allocated data to use as backing data.

    int offset

    The integer offset from the start of the backing array. The default value is 0.

    bool clearOnInit

    Whether to zero the data on instantiation. The default value is false.

    ArrayTensorData(TensorShape, Array, bool)

    Initializes and returns an instance of ArrayTensorData with a given array of data.

    Declaration
    public ArrayTensorData(TensorShape shape, Array data, bool clearOnInit = false)
    Parameters
    Type Name Description
    TensorShape shape

    The shape of the tensor data.

    Array data

    The data to use as backing data.

    bool clearOnInit

    Whether to zero the data on instantiation. The default value is false.

    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)