docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor TensorFloat

    TensorFloat(TensorShape, float[])

    Initializes and returns a tensor with the specified shape and a float[] array of srcData data.

    Declaration
    public TensorFloat(TensorShape shape, float[] srcData)
    Parameters
    Type Name Description
    TensorShape shape

    The shape of the tensor.

    float[] srcData

    The data elements of the tensor.

    TensorFloat(TensorShape, float[], int)

    Initializes and returns a tensor with specified shape and a float[] array of srcData data. Sentis reads srcData from dataStartIndex.

    srcData.Length - dataStartIndex must be bigger than or equal to shape.length.

    Declaration
    public TensorFloat(TensorShape shape, float[] srcData, int dataStartIndex = 0)
    Parameters
    Type Name Description
    TensorShape shape

    The shape of the tensor.

    float[] srcData

    The data elements of the tensor.

    int dataStartIndex

    The index of the first tensor element in the srcData array.

    TensorFloat(TensorShape, NativeArray<float>, int)

    Initializes and returns a tensor with specified shape and a native float array of srcData data. Sentis reads srcData from dataStartIndex.

    srcData.Length - dataStartIndex must be bigger than or equal to shape.length.

    Declaration
    public TensorFloat(TensorShape shape, NativeArray<float> srcData, int dataStartIndex = 0)
    Parameters
    Type Name Description
    TensorShape shape

    The shape of the tensor.

    NativeArray<float> srcData

    The data elements of the tensor.

    int dataStartIndex

    The index of the first tensor element in the srcData native array.

    TensorFloat(float)

    Initializes and returns a scalar tensor with the value of srcData.

    Declaration
    public TensorFloat(float srcData)
    Parameters
    Type Name Description
    float srcData

    The data element of the tensor.

    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)