docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class RecurrentState

    Object that represent memory (recurrent state) between the executions of a given model.

    Inheritance
    object
    RecurrentState
    Implements
    IDisposable
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Barracuda
    Assembly: solution.dll
    Syntax
    public class RecurrentState : IDisposable

    Constructors

    RecurrentState(Model, int, Dictionary<string, Tensor>)

    Constructs recurrent state for a specific model

    Declaration
    public RecurrentState(Model model, int batchSize = -1, Dictionary<string, Tensor> grabFromInputs = null)
    Parameters
    Type Name Description
    Model model

    the associated model

    int batchSize

    has to match the batch dimension of the input tensor(s). Specifying -1 will use batch size of the memory tensors as declared in the model

    Dictionary<string, Tensor> grabFromInputs

    optional dictionary of named tensors that can be used as a memory. If name of the tensor matches the memory, tensor will be removed from the dictionary and used as memory

    Methods

    AfterExecution(IWorker)

    Internal callback called after execution of the model finished. This callback stores results of the current iteration in the memory.

    Declaration
    public void AfterExecution(IWorker worker)
    Parameters
    Type Name Description
    IWorker worker

    IWorker

    BeforeExecution(IWorker)

    Internal callback called before the execution of the model. This callback prepares model for the next iteration according to the memory.

    Declaration
    public void BeforeExecution(IWorker worker)
    Parameters
    Type Name Description
    IWorker worker

    IWorker

    Dispose()

    Dispose RecurrentState

    Declaration
    public virtual void Dispose()

    ~RecurrentState()

    Finalize RecurrentState

    Declaration
    protected ~RecurrentState()

    GetBatchSize()

    Returns batch dimension used for the memories.

    Declaration
    public int GetBatchSize()
    Returns
    Type Description
    int

    batch dimension used for the memories

    Implements

    IDisposable
    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)