docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GenericWorker

    Represents a generic implementation of an IWorker.

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

    Constructors

    Name Description
    GenericWorker(Model, IBackend, IVars, bool, bool)

    Initializes and returns an instance of GenericWorker for the specified model and ops.

    Properties

    Name Description
    scheduleProgress

    Returns the proportion of the model scheduled for execution since the last call to StartManualSchedule.

    Returns 0.0 after you call StartManualSchedule. Returns 1.0 when the model is fully scheduled.

    The value increases each time you iterate on the IEnumerator that StartManualSchedule returns.

    Methods

    Name Description
    Dispose()

    Disposes of the worker and any associated memory.

    Execute()

    Schedules the execution of the model on the worker. This is non-blocking.

    Execute(IDictionary<string, Tensor>)

    Sets multiple tensors as the inputs of the model and schedules execution of the model. This is non-blocking.

    Execute(Tensor)

    Sets a tensor as the default input of the model and schedules the execution of the model on the worker. This is non-blocking. For models with more than one input this sets the first input.

    ~GenericWorker()

    Finalizes the GenericWorker.

    FlushSchedule(bool)

    Schedules the execution of the part of the model that hasn't been scheduled yet. This is non-blocking.

    GetBackend()

    Gets the backend used by the worker for execution.

    PeekOutput()

    Returns a reference to the default output tensor. This is non-blocking.

    For models with more than one output this returns a reference to the first output tensor.

    The reference is valid only until you call Execute() or Dispose() on the worker.

    If you want to dispose of the worker but keep the tensor, use FinishExecutionAndDownloadOutput() instead, or use TakeOwnership() on the output tensor.

    PeekOutput(string)

    Returns a reference to an output tensor with a given name. This is non-blocking.

    The reference is valid only until you call Execute() or Dispose() on the worker.

    If you want to dispose of the worker but keep the tensor, use FinishExecutionAndDownloadOutput() instead, or use TakeOwnership() on the output tensor.

    PrepareForInput(IDictionary<string, TensorShape>)

    Prepares the worker to execute the model using inputs of given shapes.

    SetInput(string, Tensor)

    Sets a tensor as a named input of the model.

    SetInput(Tensor)

    Sets a tensor as the default input of the model. For models with more than one input this sets the first input.

    StartManualSchedule()

    Schedules the execution of the model one layer at a time. This is non-blocking.

    To schedule the execution of the next layer of the model, call MoveNext on the IEnumerator object this method returns.

    StartManualSchedule(IDictionary<string, Tensor>)

    Sets multiple tensors as the inputs of the model and schedules execution of the model one layer at a time. This is non-blocking.

    To schedule execution of the next layer of the model, call MoveNext on the IEnumerator object this method returns.

    StartManualSchedule(Tensor)

    Sets a tensor as the default input of the model and schedules execution of the model one layer at a time. This is non-blocking. For models with more than one input this sets the first input.

    To schedule execution of the next layer of the model, call MoveNext on the IEnumerator object this method returns.

    Summary()

    Returns a summary of the execution as a string.

    Extension Methods

    WorkerExtensions.ExecuteAndDownloadOutputsAsync(IWorker, Dictionary<string, Tensor>, List<string>)
    In This Article
    Back to top
    Copyright © 2024 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)