docs.unity.cn
    Show / Hide Table of Contents

    Class ModelExtensions

    Extensions for Model class

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

    Methods

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

    Create a worker that will execute model 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 Model model, string[] additionalOutputs, string[] trimOutputs, WorkerFactory.Device device = default(WorkerFactory.Device), bool verbose = false)
    Parameters
    Type Name Description
    Model model

    the associated Model to execute

    String[] additionalOutputs

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

    String[] trimOutputs

    are the outputs not discard even if they are specified by the model

    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(Model, WorkerFactory.Device, Boolean)

    Create a worker that will execute model 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 Model model, WorkerFactory.Device device = default(WorkerFactory.Device), bool verbose = false)
    Parameters
    Type Name Description
    Model model

    the associated Model to execute

    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 © 2020 Unity Technologies
    Generated by DocFX
    on Friday, May 14, 2021