Class Constant
Represents a constant in a model.
Inherited Members
Namespace: Unity.Sentis.Layers
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. |
Constant(int, TensorShape, DataType, NativeTensorArray)
Initializes and returns a vector Constant
from a given index, shape and NativeTensorArray
array.
Declaration
public Constant(int index, TensorShape shape, DataType dataType, NativeTensorArray array)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index to use for the constant. |
TensorShape | shape | The shape to use for the constant. |
DataType | dataType | The dataType to use for the constant. |
NativeTensorArray | array | The 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 |
weights
The elements of the constant as a NativeTensorArray
.
Declaration
public NativeTensorArray weights
Field 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 |