Struct InputDef
Represents an input definition of a model at build time. This holds a data type and shape.
Inherited Members
Namespace: Unity.Sentis
Assembly: Unity.Sentis.dll
Syntax
public readonly struct InputDef
Constructors
InputDef(DataType, SymbolicTensorShape)
Initializes and returns an instance of InputDef
with data type and symbolic tensor shape.
Declaration
public InputDef(DataType dataType, SymbolicTensorShape shape)
Parameters
Type | Name | Description |
---|---|---|
DataType | dataType | The data type of the input. |
SymbolicTensorShape | shape | The shape of the input. |
InputDef(DataType, TensorShape)
Initializes and returns an instance of InputDef
with data type and tensor shape.
Declaration
public InputDef(DataType dataType, TensorShape shape)
Parameters
Type | Name | Description |
---|---|---|
DataType | dataType | The data type of the input. |
TensorShape | shape | The shape of the input. |
Properties
DataType
The data type of the input.
Declaration
public DataType DataType { get; }
Property Value
Type | Description |
---|---|
DataType |
Shape
The shape of the input.
Declaration
public SymbolicTensorShape Shape { get; }
Property Value
Type | Description |
---|---|
SymbolicTensorShape |
Methods
Float(TensorShape)
Initializes and returns an instance of InputDef
with float data type and tensor shape.
Declaration
public static InputDef Float(TensorShape shape)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | shape | The shape of the input. |
Returns
Type | Description |
---|---|
InputDef | The input def. |
FromModel(Model)
Initializes and returns an array of InputDef
with data types and tensor shapes taken from model inputs.
Declaration
public static InputDef[] FromModel(Model model)
Parameters
Type | Name | Description |
---|---|---|
Model | model | The model to use for input data types and shapes. |
Returns
Type | Description |
---|---|
InputDef[] | The input def array. |
FromModelInput(Input)
Initializes and returns an instance of InputDef
with data type and tensor shape taken from model input.
Declaration
public static InputDef FromModelInput(Model.Input input)
Parameters
Type | Name | Description |
---|---|---|
Model.Input | input | The model input to use for data type and shape. |
Returns
Type | Description |
---|---|
InputDef | The input def. |
FromTensor(Tensor)
Initializes and returns an instance of InputDef
with data type and tensor shape taken from tensor.
Declaration
public static InputDef FromTensor(Tensor tensor)
Parameters
Type | Name | Description |
---|---|---|
Tensor | tensor | The tensor to use for data type and shape. |
Returns
Type | Description |
---|---|
InputDef | The input def. |
FromTensors(Tensor[])
Initializes and returns an an array of InputDef
with data types and tensor shapes taken from tensors.
Declaration
public static InputDef[] FromTensors(Tensor[] tensors)
Parameters
Type | Name | Description |
---|---|---|
Tensor[] | tensors | The tensors to use for data type and shape. |
Returns
Type | Description |
---|---|
InputDef[] | The input def array. |
Int(TensorShape)
Initializes and returns an instance of InputDef
with int data type and tensor shape.
Declaration
public static InputDef Int(TensorShape shape)
Parameters
Type | Name | Description |
---|---|---|
TensorShape | shape | The shape of the input. |
Returns
Type | Description |
---|---|
InputDef | The input def. |
Operators
implicit operator InputDef(Input)
Initializes and returns an instance of InputDef
implicitly with data type and symbolic tensor shape from model input.
Declaration
public static implicit operator InputDef(Model.Input input)
Parameters
Type | Name | Description |
---|---|---|
Model.Input | input | The model input to use for data type and shape. |
Returns
Type | Description |
---|---|
InputDef | The input def. |