Exemple #1
0
        /// <summary>
        /// Create a worker with explicitly specified backend `type` to execute the given `model`.
        /// `type` is backend type to use. For example `WorkerFactory.Type.Compute` specifies the fast GPU path.
        /// `model` is the associated model. See ModelLoader.cs.
        /// `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.
        /// `verbose` will log scheduling of layers execution to the console.
        /// `compareAgainstType` if different than `type` model will be run on those two backend and result of every layer will be compared, checking for divergence. Great for debugging, but very slow because of the sync needed.
        /// `differenceAsError` if `compareAgainstType` is used difference will be reported as error is this is true or warning otherwise.
        /// </summary>
        public static IWorker CreateWorker(Type type, Model model, string[] additionalOutputs, string[] trimOutputs, bool verbose, Type compareAgainstType, CompareOpsUtils.LogLevel differenceLogLevel = CompareOpsUtils.LogLevel.Warning)
        {
            var workerConfiguration = new WorkerConfiguration(type, verbose);

            workerConfiguration.compareAgainstType = compareAgainstType;
            workerConfiguration.compareLogLevel    = differenceLogLevel;
            return(BarracudaBackendsFactory.CreateWorker(type, model, additionalOutputs, trimOutputs, workerConfiguration));
        }
Exemple #2
0
 /// <summary>
 /// Create a worker with explicitly specified backend `type` to execute the given `model`.
 /// `type` is backend type to use. For example `WorkerFactory.Type.Compute` specifies the fast GPU path.
 /// `model` is the associated model. See ModelLoader.cs.
 /// `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.
 /// `workerConfiguration` define configurations such as logging and comparison backend, see WorkerConfiguration API docs.
 /// </summary>
 public static IWorker CreateWorker(Type type, Model model, string[] additionalOutputs, string[] trimOutputs, WorkerConfiguration workerConfiguration)
 {
     return(BarracudaBackendsFactory.CreateWorker(type, model, additionalOutputs, trimOutputs, workerConfiguration));
 }
 /// <summary>
 /// Create a worker with explicitly specified backend `type` to execute the given `model`.
 /// </summary>
 /// <param name="type">backend type to use. For example `WorkerFactory.Type.Compute` specifies the fast GPU path</param>
 /// <param name="model">the associated model. See ModelLoader.cs</param>
 /// <param name="additionalOutputs">the additional outputs to track but not directly specified by the model</param>
 /// <param name="trimOutputs">by specifying this list of outputs, all other non-specified outputs will be discarded</param>
 /// <param name="workerConfiguration">define configurations such as logging and comparison backend, see WorkerConfiguration API docs</param>
 /// <param name="modelExecutionsReporter">execution reporter to use to track models executions</param>
 /// <returns>Worker instance</returns>
 public static IWorker CreateWorker(Type type, Model model, string[] additionalOutputs, string[] trimOutputs, WorkerConfiguration workerConfiguration, IModelExecutionsReporter modelExecutionsReporter = null)
 {
     return(BarracudaBackendsFactory.CreateWorker(type, model, additionalOutputs, trimOutputs, workerConfiguration, modelExecutionsReporter));
 }