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

#include <graph.h>

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

Public Member Functions

 Graph (const GraphDef &def, Workspace *ws)
 Default constructor. More...
 
virtual ~Graph ()
 Default deconstructor. More...
 
bool Create (const GraphDef &def, Workspace *ws) override
 Create a graph from the optimized def. More...
 
bool Run (const string &include, const string &exclude, int stream_id=0) override
 Run the graph once synchronously. More...
 
- Public Member Functions inherited from dragon::GraphBase
 GraphBase (const GraphDef &def, Workspace *ws)
 Default constructor. More...
 
virtual ~GraphBase ()
 Default deconstructor. 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

vector< OperatorBase * > ops_
 Store the internal operators. More...
 
- Protected Attributes inherited from dragon::GraphBase
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

◆ Graph()

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

Default constructor.

◆ ~Graph()

virtual dragon::Graph::~Graph ( )
inlinevirtual

Default deconstructor.

Member Function Documentation

◆ Create()

bool dragon::Graph::Create ( const GraphDef &  def,
Workspace ws 
)
overridevirtual

Create a graph from the optimized def.

Implements dragon::GraphBase.

◆ Run()

bool dragon::Graph::Run ( const string &  include,
const string &  exclude,
int  stream_id = 0 
)
overridevirtual

Run the graph once synchronously.

Implements dragon::GraphBase.

Member Data Documentation

◆ ops_

vector<OperatorBase*> dragon::Graph::ops_
protected

Store the internal operators.


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