Class WorkerExtensions
Provides extension methods for the IWorker
interface.
Inherited Members
Namespace: Unity.Sentis
Assembly: Unity.Sentis.dll
Syntax
public static class WorkerExtensions
Methods
ExecuteAndDownloadOutputsAsync(IWorker, Dictionary<string, Tensor>, List<string>)
Execute model and returns a CPU copy of all outputs. This is a non blocking call.
Declaration
public static Task<bool[]> ExecuteAndDownloadOutputsAsync(this IWorker worker, Dictionary<string, Tensor> inputs, List<string> outputs)
Parameters
Type | Name | Description |
---|---|---|
IWorker | worker | The worker to execute. |
Dictionary<string, Tensor> | inputs | The input tensors as a dictionary. |
List<string> | outputs | The output names as a list. |
Returns
Type | Description |
---|---|
Task<bool[]> | The async task. |
ExecuteWorker(CommandBuffer, IWorker, Dictionary<string, Tensor>)
Non-blocking API that schedules network execution on CommandBuffer in one go.
Declaration
public static void ExecuteWorker(this CommandBuffer cb, IWorker worker, Dictionary<string, Tensor> inputs)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cb | The command buffer to schedule execution on. |
IWorker | worker | The worker to use for execution. |
Dictionary<string, Tensor> | inputs | A dictionary of input tensors. |
ExecuteWorker(CommandBuffer, IWorker, Tensor)
Non-blocking API that schedules network execution on CommandBuffer in one go.
Declaration
public static void ExecuteWorker(this CommandBuffer cb, IWorker worker, Tensor input)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cb | The command buffer to schedule execution on. |
IWorker | worker | The worker to use for execution. |
Tensor | input | The input tensor. |