docs.unity3d.com
    Show / Hide Table of Contents

    Class NNModelExtensions

    Extensions for NNModel class

    Inheritance
    Object
    NNModelExtensions
    Namespace: Unity.Barracuda
    Syntax
    public static class NNModelExtensions : object

    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.

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

    the associated NNModel asset

    String[] additionalOutputs

    the additional outputs to track but not directly specified by the model

    String[] trimOutputs

    by specifying this list of outputs, all other non-specified outputs will be discarded

    WorkerFactory.Device device

    the device type to run worker on. For example WorkerFactory.Device.GPU specifies the fast GPU path

    Boolean verbose

    will log scheduling of layers execution to the console (default == false)

    Returns
    Type Description
    IWorker

    Worker instance

    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.

    Declaration
    public static IWorker CreateWorker(this NNModel asset, WorkerFactory.Device device = default(WorkerFactory.Device), bool verbose = false)
    Parameters
    Type Name Description
    NNModel asset

    the associated NNModel asset

    WorkerFactory.Device device

    the preferred device for execution. For example WorkerFactory.Device.GPU specifies the fast GPU path

    Boolean verbose

    will log scheduling of layers execution to the console

    Returns
    Type Description
    IWorker

    Worker instance

    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