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.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Sentis
    Assembly: Unity.Sentis.dll
    Syntax
    public class Constant

    Constructors

    Constant(int, TensorShape, float[])

    Initializes and returns a vector Constant from a given index, shape and float array.

    Declaration
    public Constant(int index, TensorShape shape, float[] value)
    Parameters
    Type Name Description
    int index

    The index to use for the constant.

    TensorShape shape

    The shape to use for the constant.

    float[] value

    The float array of values.

    Fields

    dataType

    The data type of the constant as a DataType.

    Declaration
    public DataType dataType
    Field Value
    Type Description
    DataType

    index

    The index of the constant.

    Declaration
    public int index
    Field Value
    Type Description
    int

    lengthBytes

    The size of the constant in bytes.

    Declaration
    public int lengthBytes
    Field Value
    Type Description
    int

    shape

    The shape of the constant as a TensorShape.

    Declaration
    public TensorShape shape
    Field Value
    Type Description
    TensorShape

    Properties

    weights

    The elements of the constant as a NativeTensorArrayFromManagedArray.

    Declaration
    public NativeTensorArray weights { get; set; }
    Property Value
    Type Description
    NativeTensorArray

    Methods

    ToString()

    Returns a string that represents the Constant.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the Constant.

    Overrides
    object.ToString()
    In This Article
    Back to top
    Copyright © 2025 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)