docs.unity3d.com
    Show / Hide Table of Contents

    Class WorkerFactory

    Provides methods for instantiating workers and ops on given back ends.

    Inheritance
    Object
    WorkerFactory
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Sentis
    Syntax
    public class WorkerFactory

    Methods

    CreateOps(BackendType, ITensorAllocator)

    Initializes and returns an instance of Ops on a given back end.

    Declaration
    public static Ops CreateOps(BackendType backendType, ITensorAllocator allocator)
    Parameters
    Type Name Description
    BackendType backendType
    ITensorAllocator allocator
    Returns
    Type Description
    Ops

    CreateWorker(BackendType, Model, Boolean)

    Initializes and returns an instance of IWorker on a given back end with a model to execute.

    Declaration
    public static IWorker CreateWorker(BackendType backendType, Model model, bool verbose = false)
    Parameters
    Type Name Description
    BackendType backendType
    Model model
    Boolean verbose
    Returns
    Type Description
    IWorker

    CreateWorker(BackendType, Model, WorkerFactory.WorkerConfiguration)

    Initializes and returns an instance of IWorker on a given back end with a model to execute and workerConfiguration.

    Declaration
    public static IWorker CreateWorker(BackendType backendType, Model model, WorkerFactory.WorkerConfiguration workerConfiguration)
    Parameters
    Type Name Description
    BackendType backendType
    Model model
    WorkerFactory.WorkerConfiguration workerConfiguration
    Returns
    Type Description
    IWorker

    CreateWorker(Model, DeviceType, Boolean)

    Initializes and returns an instance of IWorker on a given device with a model to execute. Sentis selects the best backend type available for deviceType.

    Declaration
    public static IWorker CreateWorker(Model model, DeviceType deviceType, bool verbose = false)
    Parameters
    Type Name Description
    Model model
    DeviceType deviceType
    Boolean verbose
    Returns
    Type Description
    IWorker

    GetBestTypeForDevice(DeviceType)

    Returns the best backend type for the given deviceType.

    Declaration
    public static BackendType GetBestTypeForDevice(DeviceType deviceType)
    Parameters
    Type Name Description
    DeviceType deviceType
    Returns
    Type Description
    BackendType

    IsType(BackendType, DeviceType)

    Checks if a backend is a given backendType. For example, IsType(Type.ComputeShader, DeviceType.GPU) returns true.

    Declaration
    public static bool IsType(BackendType backendType, DeviceType deviceType)
    Parameters
    Type Name Description
    BackendType backendType
    DeviceType deviceType
    Returns
    Type Description
    Boolean
    In This Article
    • Methods
      • CreateOps(BackendType, ITensorAllocator)
      • CreateWorker(BackendType, Model, Boolean)
      • CreateWorker(BackendType, Model, WorkerFactory.WorkerConfiguration)
      • CreateWorker(Model, DeviceType, Boolean)
      • GetBestTypeForDevice(DeviceType)
      • IsType(BackendType, DeviceType)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023