Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
caffe2::DAGNetBase Class Referenceabstract
Inheritance diagram for caffe2::DAGNetBase:
caffe2::NetBase caffe2::AsyncDAGNet caffe2::DAGNet

Public Types

using ExecutionChains = std::unordered_map< int, std::vector< int > >
 

Public Member Functions

 DAGNetBase (const NetDef &net_def, Workspace *ws)
 
bool Run () override
 
void WorkerFunction ()
 
vector< float > TEST_Benchmark (const int warmup_runs, const int main_runs, const bool run_individual) override
 Benchmarks a network. More...
 
const ExecutionChains & TEST_execution_chains () const
 
- Public Member Functions inherited from caffe2::NetBase
 NetBase (const NetDef &net_def, Workspace *ws)
 
virtual bool RunAsync ()
 
const vector< string > & external_output () const
 
const vector< string > & external_input () const
 

Protected Member Functions

virtual bool RunAt (const std::vector< int > &chain)=0
 
 DISABLE_COPY_AND_ASSIGN (DAGNetBase)
 
- Protected Member Functions inherited from caffe2::NetBase
 DISABLE_COPY_AND_ASSIGN (NetBase)
 

Protected Attributes

vector< internal::OperatorNodeoperator_nodes_
 
ExecutionChains execution_chains_
 
vector< int > initial_frontier_
 
SimpleQueue< int > job_queue_
 
std::vector< std::thread > workers_
 
int num_workers_
 
int remaining_ops_
 
bool success_
 
std::mutex remaining_ops_mutex_
 
std::condition_variable cv_
 
std::mutex run_in_progress_
 
- Protected Attributes inherited from caffe2::NetBase
vector< string > external_input_
 
vector< string > external_output_
 
string name_
 

Detailed Description

Definition at line 124 of file net.h.

Member Function Documentation

◆ TEST_Benchmark()

vector< float > caffe2::DAGNetBase::TEST_Benchmark ( const int  warmup_runs,
const int  main_runs,
const bool  run_individual 
)
overridevirtual

Benchmarks a network.

This function returns a vector of float recording the number of milli- seconds spent during the benchmark. The 0-th item is the time spent per each network run, and if a net instantiation supports run_individual, the remainder of the vector returns the number of milliseconds spent per opeartor.

Reimplemented from caffe2::NetBase.

Definition at line 532 of file net_dag.cc.


The documentation for this class was generated from the following files: