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 Inference Engine runtime model.
Inherited Members
Namespace: Unity.InferenceEngine
Assembly: Unity.InferenceEngine.dll
Syntax
[MovedFrom("Unity.Sentis")]
public class FunctionalGraph
  Methods
AddInput(DataType, DynamicTensorShape, string)
Append an input to the graph with an input def.
Declaration
public FunctionalTensor AddInput(DataType dataType, DynamicTensorShape shape, string name = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataType | dataType | The data type of the input.  | 
      
| DynamicTensorShape | shape | The shape of the input.  | 
      
| string | name | The name of the input.  | 
      
Returns
| Type | Description | 
|---|---|
| FunctionalTensor | The functional tensor input.  | 
      
AddInput(DataType, TensorShape, string)
Append an input to the graph with an input def.
Declaration
public FunctionalTensor AddInput(DataType dataType, TensorShape shape, string name = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DataType | dataType | The data type of the input.  | 
      
| TensorShape | shape | The shape of the input.  | 
      
| string | name | The name of the input.  | 
      
Returns
| Type | Description | 
|---|---|
| FunctionalTensor | The functional tensor input.  | 
      
AddInput(Model, int, string)
Append an input to the graph matching a model input.
Declaration
public FunctionalTensor AddInput(Model model, int index, string name = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Model | model | The model.  | 
      
| int | index | The input index of the input in the provided model.  | 
      
| string | name | Name to use for this input. 
 | 
      
Returns
| Type | Description | 
|---|---|
| FunctionalTensor | The functional tensor input.  | 
      
AddInput<T>(DynamicTensorShape, string)
Append an input to the graph with a type T and dynamic tensor shape.
Declaration
public FunctionalTensor AddInput<T>(DynamicTensorShape shape, string name = null) where T : unmanaged
  Parameters
| Type | Name | Description | 
|---|---|---|
| DynamicTensorShape | shape | The shape of the input.  | 
      
| string | name | The name 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, string)
Append an input to the graph with a type T and static tensor shape.
Declaration
public FunctionalTensor AddInput<T>(TensorShape shape, string name = null) where T : unmanaged
  Parameters
| Type | Name | Description | 
|---|---|---|
| TensorShape | shape | The shape of the input.  | 
      
| string | name | The name 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.  | 
      
AddOutput(FunctionalTensor, string)
Append an output to the graph from a functional tensor.
Declaration
public void AddOutput(FunctionalTensor output, string name = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FunctionalTensor | output | The output functional tensor.  | 
      
| string | name | The name for the output. 
 | 
      
AddOutputs(params FunctionalTensor[])
Append outputs to the graph from multiple functional tensors.
Declaration
public void AddOutputs(params FunctionalTensor[] outputs)
  Parameters
| Type | Name | Description | 
|---|---|---|
| FunctionalTensor[] | outputs | The output functional tensors.  | 
      
Compile()
Compile and return an optimized runtime model.
Declaration
public Model Compile()
  Returns
| Type | Description | 
|---|---|
| Model | The compiled runtime model.  | 
      
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.  |