Dragon - C++ API
A Computation Graph Virtual Machine Based Deep Learning Framework
Public Member Functions | Protected Attributes | List of all members
dragon::GraphBase Class Referenceabstract

#include <graph.h>

Inheritance diagram for dragon::GraphBase:
dragon::Graph

Public Member Functions

 GraphBase (const GraphDef &def, Workspace *ws)
 Default constructor. More...
 
virtual ~GraphBase ()
 Default deconstructor. More...
 
virtual bool Create (const GraphDef &def, Workspace *ws)=0
 Create a graph from the optimized def. More...
 
virtual bool Run (const string &include, const string &exclude, int stream_id=0)=0
 Run the graph once synchronously. More...
 
string name () const
 Return the graph name. More...
 
const string & phase () const
 Return the defined running phase. More...
 
const Map< std::string, const Argument * > & args ()
 Return the argument map. More...
 
const Argument & arg (const string &name)
 Return the specified argument. More...
 
const GraphDef & def () const
 Return the stored raw def. More...
 
const GraphDef & opt_def () const
 Return the stored opt def. More...
 
Workspacews () const
 Return the parent workspace. More...
 

Protected Attributes

string name_
 Store the name and running phase. More...
 
string phase_
 
Map< string, const Argument * > args_
 Store the defined arguments. More...
 
Workspacews_
 Store the parent workspace. More...
 
GraphDef def_
 Store the def. More...
 
GraphDef opt_def_
 

Constructor & Destructor Documentation

◆ GraphBase()

dragon::GraphBase::GraphBase ( const GraphDef &  def,
Workspace ws 
)

Default constructor.

◆ ~GraphBase()

virtual dragon::GraphBase::~GraphBase ( )
inlinevirtual

Default deconstructor.

Member Function Documentation

◆ arg()

const Argument& dragon::GraphBase::arg ( const string &  name)
inline

Return the specified argument.

◆ args()

const Map<std::string, const Argument*>& dragon::GraphBase::args ( )
inline

Return the argument map.

◆ Create()

virtual bool dragon::GraphBase::Create ( const GraphDef &  def,
Workspace ws 
)
pure virtual

Create a graph from the optimized def.

Implemented in dragon::Graph.

◆ def()

const GraphDef& dragon::GraphBase::def ( ) const
inline

Return the stored raw def.

◆ name()

string dragon::GraphBase::name ( ) const
inline

Return the graph name.

◆ opt_def()

const GraphDef& dragon::GraphBase::opt_def ( ) const
inline

Return the stored opt def.

◆ phase()

const string& dragon::GraphBase::phase ( ) const
inline

Return the defined running phase.

◆ Run()

virtual bool dragon::GraphBase::Run ( const string &  include,
const string &  exclude,
int  stream_id = 0 
)
pure virtual

Run the graph once synchronously.

Implemented in dragon::Graph.

◆ ws()

Workspace* dragon::GraphBase::ws ( ) const
inline

Return the parent workspace.

Member Data Documentation

◆ args_

Map<string, const Argument*> dragon::GraphBase::args_
protected

Store the defined arguments.

◆ def_

GraphDef dragon::GraphBase::def_
protected

Store the def.

◆ name_

string dragon::GraphBase::name_
protected

Store the name and running phase.

◆ opt_def_

GraphDef dragon::GraphBase::opt_def_
protected

◆ phase_

string dragon::GraphBase::phase_
protected

◆ ws_

Workspace* dragon::GraphBase::ws_
protected

Store the parent workspace.


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