Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Protected Member Functions | Protected Attributes
caffe2::NetBase Class Referenceabstract
Inheritance diagram for caffe2::NetBase:
caffe2::Observable< NetBase > caffe2::AsyncNetBase caffe2::AsyncSimpleNet caffe2::DAGNetBase caffe2::SimpleNet caffe2::AsyncPollingNet caffe2::AsyncSchedulingNet caffe2::AsyncDAGNet caffe2::DAGNet caffe2::gpu_single_thread::SingleThreadAsyncNet

Public Member Functions

 NetBase (const std::shared_ptr< const NetDef > &net_def, Workspace *ws)
 
virtual bool SupportsAsync ()=0
 
const vector< const Event * > & events () const
 
virtual void Wait ()
 
virtual bool Run ()
 
virtual bool RunAsync ()
 
virtual vector< float > TEST_Benchmark (const int, const int, const bool)
 Benchmarks a network. More...
 
const vector< string > & external_output () const
 
const vector< string > & external_input () const
 
virtual vector< OperatorBase * > GetOperators () const =0
 
const string & Name () const
 
const NetDef & debug_def () const
 
bool has_debug_def () const
 
- Public Member Functions inherited from caffe2::Observable< NetBase >
const ObserverAttachObserver (std::unique_ptr< Observer > observer)
 
std::unique_ptr< ObserverDetachObserver (const Observer *observer_ptr)
 Returns a unique_ptr to the removed observer. More...
 
virtual size_t NumObservers ()
 
void StartAllObservers ()
 
void StopAllObservers ()
 

Protected Member Functions

virtual bool DoRunAsync ()
 
 DISABLE_COPY_AND_ASSIGN (NetBase)
 

Protected Attributes

vector< string > external_input_
 
vector< string > external_output_
 
string name_
 
vector< const Event * > events_
 
std::shared_ptr< const NetDef > net_def_
 
- Protected Attributes inherited from caffe2::Observable< NetBase >
std::vector< std::unique_ptr< Observer > > observers_list_
 

Additional Inherited Members

- Public Types inherited from caffe2::Observable< NetBase >
using Observer = ObserverBase< NetBase >
 

Detailed Description

Definition at line 51 of file net.h.

Member Function Documentation

virtual vector<float> caffe2::NetBase::TEST_Benchmark ( const int  ,
const int  ,
const bool   
)
inlinevirtual

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 in caffe2::DAGNetBase, caffe2::AsyncSimpleNet, and caffe2::SimpleNet.

Definition at line 93 of file net.h.


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