Class FunctionalGraph
Represents a model graph using the functional API.
Input functional tensors can be added to the graph, then manipulated using the functional API methods.
The functional graph can be compiled to return an optimized Sentis runtime model.
Inherited Members
Namespace: Unity.Sentis
Assembly: Unity.Sentis.dll
Syntax
public class FunctionalGraph
Methods
AddInput(DataType, DynamicTensorShape)
Append an input to the graph with an input def.
Declaration
public FunctionalTensor AddInput(DataType dataType, DynamicTensorShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| DataType | dataType | The data type of the input. |
| DynamicTensorShape | shape | The shape of the input. |
Returns
| Type | Description |
|---|---|
| FunctionalTensor | The functional tensor input. |
AddInput(DataType, TensorShape)
Append an input to the graph with an input def.
Declaration
public FunctionalTensor AddInput(DataType dataType, TensorShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| DataType | dataType | The data type of the input. |
| TensorShape | shape | The shape of the input. |
Returns
| Type | Description |
|---|---|
| FunctionalTensor | The functional tensor input. |
AddInput(Model, int)
Append an input to the graph matching a model input.
Declaration
public FunctionalTensor AddInput(Model model, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | model | The model. |
| int | index | The input index of the input in the provided model. |
Returns
| Type | Description |
|---|---|
| FunctionalTensor | The functional tensor input. |
AddInput<T>(DynamicTensorShape)
Append an input to the graph with a type T and dynamic tensor shape.
Declaration
public FunctionalTensor AddInput<T>(DynamicTensorShape shape) where T : unmanaged
Parameters
| Type | Name | Description |
|---|---|---|
| DynamicTensorShape | shape | The shape of the input. |
Returns
| Type | Description |
|---|---|
| FunctionalTensor | The functional tensor input. |
Type Parameters
| Name | Description |
|---|---|
| T | The data type of the input. |
AddInput<T>(TensorShape)
Append an input to the graph with a type T and static tensor shape.
Declaration
public FunctionalTensor AddInput<T>(TensorShape shape) where T : unmanaged
Parameters
| Type | Name | Description |
|---|---|---|
| TensorShape | shape | The shape of the input. |
Returns
| Type | Description |
|---|---|
| FunctionalTensor | The functional tensor input. |
Type Parameters
| Name | Description |
|---|---|
| T | The data type of the input. |
AddInputs(Model)
Append inputs to the graph matching all of a model's input.
Declaration
public FunctionalTensor[] AddInputs(Model model)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | model | The model. |
Returns
| Type | Description |
|---|---|
| FunctionalTensor[] | The functional tensor input array. |
Compile(params FunctionalTensor[])
Compile and return an optimized runtime model with given outputs.
Declaration
public Model Compile(params FunctionalTensor[] outputs)
Parameters
| Type | Name | Description |
|---|---|---|
| FunctionalTensor[] | outputs | The outputs. |
Returns
| Type | Description |
|---|---|
| Model | The compiled runtime model. |