docs.unity3d.com
  • Manual
  • Scripting API
  • Changelog
  • License
    Show / Hide Table of Contents
    • Unity.​Sentis
      • Alloc​Scope
      • Array​Tensor​Data
      • Backend​Type
      • Burst​Tensor​Data
      • Channel
      • Channel​Swizzle
      • Compute​Info
      • Compute​Shader​Singleton
      • Compute​Tensor​Data
      • Coord​Origin
      • CPUOps
      • Data​Type
      • Device​Type
      • Dim​Type
      • Execution​Context
      • Generic​Worker
      • GPUCommand​Buffer​Ops
      • GPUCompute​Ops
      • GPUPixel​Ops
      • IConvertible​To​Array​Tensor​Data
      • IConvertible​To​Burst​Tensor​Data
      • IConvertible​To​Compute​Tensor​Data
      • IDependable​Memory​Resource
      • IOps
      • ITensor​Allocator
      • ITensor​Data
      • IVars
      • IWorker
      • Model
      • Model.​Importer​Warning
      • Model.​Input
      • Model.​Opset​Description
      • Model.​Warning​Type
      • Model​Asset
      • Model​Asset​Data
      • Model​Asset​Extensions
      • Model​Asset​Weights​Data
      • Model​Extensions
      • Model​Loader
      • Native​Tensor​Array
      • Native​Tensor​Array​From​Managed​Array
      • Non​Deterministic​Output
      • Pixel​Shader​Singleton
      • Random
      • Shared​Array​Tensor​Data
      • Symbolic​Tensor​Dim
      • Symbolic​Tensor​Shape
      • Tensor
      • Tensor​Extensions
      • Tensor​Float
      • Tensor​Int
      • Tensor​Layout
      • Tensor​NDIterator
      • Tensor​Shape
      • Texture​Converter
      • Texture​Tensor​Data
      • Texture​Transform
      • Wait​For​Completion
      • Worker​Extensions
      • Worker​Factory
      • Worker​Factory.​Worker​Configuration
    • Unity.​Sentis.​Layers
      • Abs
      • Acos
      • Acosh
      • Activation
      • Add
      • And
      • Arg​Max
      • Arg​Min
      • Asin
      • Asinh
      • Atan
      • Atanh
      • Auto​Pad
      • Average​Pool
      • Axis​Normalization
      • Bernoulli
      • Broadcast
      • Cast
      • Cast​Like
      • Ceil
      • Celu
      • Center​Point​Box
      • Clip
      • Compress
      • Concat
      • Constant
      • Constant​Of​Shape
      • Conv
      • Conv2DTrans
      • Coord​Transform​Mode
      • Cos
      • Cosh
      • Cum​Sum
      • Dense
      • Depth​To​Space
      • Depth​To​Space​Mode
      • Div
      • Einsum
      • Elu
      • Equal
      • Erf
      • Exp
      • Expand
      • Flags
      • Flatten
      • Floor
      • Fusable​Activation
      • Fused​Activation
      • Gather
      • Gather​Elements
      • Gather​ND
      • Gelu
      • Global​Average​Pool
      • Global​Max​Pool
      • Greater
      • Greater​Or​Equal
      • Hardmax
      • Hard​Sigmoid
      • Hard​Swish
      • Identity
      • Instance​Normalization
      • Interpolation​Mode
      • Is​Inf
      • Is​Na​N
      • Layer
      • Leaky​Relu
      • Less
      • Less​Or​Equal
      • Log
      • Log​Softmax
      • LRN
      • LSTM
      • Mat​Mul
      • Mat​Mul2D
      • Max
      • Max​Pool
      • Mean
      • Min
      • Mod
      • Mul
      • Multinomial
      • Nearest​Mode
      • Neg
      • Non​Max​Suppression
      • Non​Zero
      • Not
      • One​Hot
      • Or
      • Pad
      • Pad​Mode
      • Pow
      • PRelu
      • Random​Layer
      • Random​Normal
      • Random​Normal​Like
      • Random​Uniform
      • Random​Uniform​Like
      • Range
      • Reciprocal
      • Reduce
      • Reduce​L1
      • Reduce​L2
      • Reduce​Log​Sum
      • Reduce​Log​Sum​Exp
      • Reduce​Max
      • Reduce​Mean
      • Reduce​Min
      • Reduce​Prod
      • Reduce​Sum
      • Reduce​Sum​Square
      • Relu
      • Relu6
      • Reshape
      • Resize
      • Rnn​Activation
      • Rnn​Direction
      • Rnn​Layout
      • Roi​Align
      • Roi​Pooling​Mode
      • Round
      • Scale​Bias
      • Scale​Mode
      • Scatter​Elements
      • Scatter​ND
      • Scatter​Reduction​Mode
      • Selu
      • Shape
      • Shrink
      • Sigmoid
      • Sign
      • Sin
      • Sinh
      • Size
      • Slice
      • Softmax
      • Softplus
      • Softsign
      • Space​To​Depth
      • Split
      • Sqrt
      • Square
      • Squeeze
      • Sub
      • Sum
      • Swish
      • Tan
      • Tanh
      • Thresholded​Relu
      • Tile
      • Top​K
      • Transpose
      • Trilu
      • Trilu​Mode
      • Unsqueeze
      • Where
      • Xor
    • Scripting API
    • Unity.​Sentis
    • Worker​Factory

    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 IOps on a given back end.

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

    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

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    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