Class Constant
Represents a constant in a model.
Inherited Members
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 |