num_workers_, 0, "Expected positive number of worker threads");
helper_ = caffe2::make_unique<ParallelNetExecutorHelper>(this);
- task_graph_ = TaskGraphRegistry()->Create(
- FLAGS_caffe2_task_graph_engine, helper_.get(), options_);
// initialize operators
operator_nodes_ = dag_utils::prepareOperatorNodes(net_def, ws);
operators_.push_back(op);
}
+ task_graph_ = TaskGraphRegistry()->Create(
+ FLAGS_caffe2_task_graph_engine, helper_.get(), options_);
+ CAFFE_ENFORCE(task_graph_, "Couldn't initialize task graph");
+
// compute chains
// TODO: inference mode for chaining
auto execution_chains = dag_utils::computeChains(operator_nodes_);