Class WorkerExtensions
Provides extension methods for the IWorker
interface.
Inherited Members
Namespace: Unity.Sentis
Syntax
public static class WorkerExtensions
Methods
CopyOutput(IWorker)
Returns a CPU copy of the first output tensor. This is a blocking method, so the rest of your code waits until the model fully executes.
Declaration
public static Tensor CopyOutput(this IWorker worker)
Parameters
Type | Name | Description |
---|---|---|
IWorker | worker |
Returns
Type | Description |
---|---|
Tensor |
CopyOutput(IWorker, String)
Returns a CPU copy of a given output tensor name
. This is a blocking method, so the rest of your code waits until the model fully executes.
Declaration
public static Tensor CopyOutput(this IWorker worker, string name)
Parameters
Type | Name | Description |
---|---|---|
IWorker | worker | |
String | name |
Returns
Type | Description |
---|---|
Tensor |
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 | CommandBuffer |
IWorker | worker | IWorker |
Dictionary<String, Tensor> | inputs | 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 | CommandBuffer |
IWorker | worker | IWorker |
Tensor | input | Input Tensor |