Class NNModelExtensions | Barracuda | 1.1.2-preview
docs.unity.cn
    Show / Hide Table of Contents

    Class NNModelExtensions

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

    Methods

    CreateWorker(NNModel, String[], String[], WorkerFactory.Device, Boolean)

    Create a worker that will execute asset using the best backend that is available for a given device type. This is just a convenience function that internally calls ModelLoader.Load followed by `WorkerFactory.CreateWorker. asset is the associated NNModel asset. additionalOutputs are the additional outputs to track but not directly specified by the model. trimOutputs are the outputs not discard even if they are specified by the model. device is the device type to run worker on. For example WorkerFactory.Device.GPU specifies the fast GPU path. verbose will log scheduling of layers execution to the console (default == false).

    Declaration
    public static IWorker CreateWorker(this NNModel asset, string[] additionalOutputs, string[] trimOutputs, WorkerFactory.Device device = WorkerFactory.Device.Auto, bool verbose = false)
    Parameters
    Type Name Description
    NNModel asset
    String[] additionalOutputs
    String[] trimOutputs
    WorkerFactory.Device device
    Boolean verbose
    Returns
    Type Description
    IWorker

    CreateWorker(NNModel, WorkerFactory.Device, Boolean)

    Create a worker that will execute asset using the best backend that is available for a given device type. This is just a convenience function that internally calls ModelLoader.Load followed by `WorkerFactory.CreateWorker. asset is the associated NNModel asset. device is the preferred device for execution. For example WorkerFactory.Device.GPU specifies the fast GPU path. verbose will log scheduling of layers execution to the console.

    Declaration
    public static IWorker CreateWorker(this NNModel asset, WorkerFactory.Device device = WorkerFactory.Device.Auto, bool verbose = false)
    Parameters
    Type Name Description
    NNModel asset
    WorkerFactory.Device device
    Boolean verbose
    Returns
    Type Description
    IWorker
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on 15 October 2020