docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    FunctionalGraph
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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.

     If name is null Inference Engine uses the name from the model.
    
    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.

     If null the name will be "output_{idx}" or inferred from the original model in case this functional tensor is the output of a forward pass of an existing model.
    

    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.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)