docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Constant

    Represents a constant in a model.

    Inheritance
    object
    Constant
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Sentis.Layers
    Assembly: solution.dll
    Syntax
    public class Constant

    Constructors

    Name Description
    Constant()

    Initializes and returns an empty Constant.

    Constant(string, int[])

    Initializes and returns a vector Constant from a given name and int array.

    Constant(string, float[])

    Initializes and returns a vector Constant from a given name and float array.

    Constant(string, Tensor)

    Initializes and returns a Constant from a given name and tensor.

    Fields

    Name Description
    dataType

    The data type of the constant as a DataType.

    length

    The number of elements in the constant.

    name

    The name of the constant.

    offset

    The offset of the first element of the constant in the weights array.

    shape

    The shape of the constant as a TensorShape.

    weights

    The elements of the constant as a NativeTensorArray.

    Methods

    Name Description
    DataSetToTensor()

    Creates and returns a CPU Tensor of the constant.

    TensorToDataSet(Tensor)

    Initializes the constant with the shape, dataType and weights from a given Tensor.

    ToString()

    Returns a string that represents the Constant.

    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)