Class Constant
Represents a constant in a model.
Inherited Members
Namespace: Unity.Sentis.Layers
Assembly: Unity.Sentis.dll
Syntax
public class Constant
Constructors
Constant(string, int[])
Initializes and returns a vector Constant
from a given index and int array.
Declaration
public Constant(string index, int[] value)
Parameters
Type | Name | Description |
---|---|---|
string | index | The index to use for the constant. |
int[] | value | The int array of values. |
Constant(string, float[])
Initializes and returns a vector Constant
from a given index and float array.
Declaration
public Constant(string index, float[] value)
Parameters
Type | Name | Description |
---|---|---|
string | index | The index to use for the constant. |
float[] | value | The float array of values. |
Constant(string, Tensor)
Initializes and returns a vector Constant
from a given index and tensor.
Declaration
public Constant(string index, Tensor tensor)
Parameters
Type | Name | Description |
---|---|---|
string | index | The index to use for the constant. |
Tensor | tensor | The tensor to take the shape, dataType and weights of the constant from. |
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 string index
Field Value
Type | Description |
---|---|
string |
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 |
Methods
ToString()
Returns a string that represents the Constant
.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of the |