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

#include <pool_op.h>

Inheritance diagram for dragon::Pool2dOp< Context >:
dragon::Operator< Context > dragon::OperatorBase dragon::CuDNNPool2dOp< Context >

Public Member Functions

 Pool2dOp (const OperatorDef &def, Workspace *ws)
 
void Reshape ()
 
void RunOnDevice () override
 Implement the detailed execution. More...
 
template<typename T >
void MaxRunImpl ()
 
template<typename T >
void AvgRunImpl ()
 
- Public Member Functions inherited from dragon::Operator< Context >
 Operator (const OperatorDef &def, Workspace *ws)
 Default constructor. More...
 
void Run (int stream_id=0) final
 Run this operator on the specified stream. More...
 
virtual void PrepareResource ()
 Prepare the content of inputs. More...
 
virtual void ReleaseResource ()
 Release the ownership of inputs. More...
 
virtual void MemorySwitch ()
 Coordinate the context of inputs and outputs. More...
 
Context * ctx ()
 Return the internal context. More...
 
bool AllowRun ()
 Whether this operator can be ignored. More...
 
- Public Member Functions inherited from dragon::OperatorBase
 OperatorBase (const OperatorDef &def, Workspace *ws)
 Default constructor. More...
 
virtual ~OperatorBase ()
 Default deconstructor. More...
 
TensorX (int i)
 Return the specified input tensor. More...
 
TensorY (int i)
 Return the specified output tensor. More...
 
int XSize ()
 Return the number of inputs. More...
 
int YSize ()
 Return the number of outputs. More...
 
void UpdateFrom (const OperatorDef &def)
 Modify operator according to the given def. More...
 
void SwitchToPhase (const string &phase)
 Switch the internal running phase. More...
 
virtual void Fusion (void *graph)
 Fusion this operator into the specified graph. More...
 
const string & name () const
 Return the operator name. More...
 
const string & type () const
 Return the operator type. More...
 
const string & phase () const
 Return the current running phase. More...
 
const string & handle () const
 Return the resource handle. More...
 
const string & dtype () const
 Return the data type. More...
 
const string & data_format () const
 Return the data format. More...
 
const string unique_name (const string &name) const
 Return the unique name in this operator. More...
 
Workspacews () const
 Return the parent workspace. More...
 
template<typename T >
Arg (const string &name, const T &default_value)
 Return the value of the specified argument. More...
 
template<typename T >
vector< T > Args (const string &name)
 Return the values of the specified argument. More...
 
const Map< std::string, const Argument * > & args ()
 Return the argument map. More...
 
const Argument & arg (const string &name)
 Return the specified argument. More...
 
SubGraphsubgraph ()
 Return the recomputing subgraph. More...
 
void set_subgraph (SubGraph subgraph)
 Set the given recomputing subgraph. More...
 
const OperatorDef & def () const
 Return the stored def. More...
 
string DebugString () const
 Return the debug string of stored def. More...
 
string DTypeString (const Tensor &, const Set< string > &) const
 Return the dtype string according to given tensor. More...
 
string DTypeString (const string &, const Set< string > &) const
 

Public Attributes

 USE_OPERATOR_FUNCTIONS
 

Protected Attributes

string mode_
 
string padding_
 
bool global_pool_
 
bool ceil_mode_
 
vec64_t kshape_
 
vec64_t stride_
 
vec64_t pad_l_
 
vec64_t pad_r_
 
int64_t n_
 
int64_t c_
 
int64_t h_
 
int64_t w_
 
int64_t pool_h_
 
int64_t pool_w_
 
- Protected Attributes inherited from dragon::Operator< Context >
Context ctx_
 Store the internal context. More...
 
bool allow_run_
 
bool allow_recomp_
 
bool do_sync_
 
- Protected Attributes inherited from dragon::OperatorBase
Workspacews_
 Store the parent workspace. More...
 
OperatorDef def_
 Store the def. More...
 
SubGraph subgraph_
 Store the recomputing subgraph. More...
 
string phase_
 Store the phase and handle. More...
 
string handle_
 
string dtype_
 Store the data type and format. More...
 
string data_format_
 
vector< Tensor * > inputs_
 Store the pointer of inputs and outputs. More...
 
vector< Tensor * > outputs_
 
Map< string, const Argument * > args_
 Store the defined arguments. More...
 

Additional Inherited Members

- Public Types inherited from dragon::OperatorBase
typedef Map< string, vector< OperatorBase * > > SubGraph
 

Constructor & Destructor Documentation

◆ Pool2dOp()

template<class Context >
dragon::Pool2dOp< Context >::Pool2dOp ( const OperatorDef &  def,
Workspace ws 
)
inline

Member Function Documentation

◆ AvgRunImpl()

template<class Context >
template<typename T >
void dragon::Pool2dOp< Context >::AvgRunImpl ( )

◆ MaxRunImpl()

template<class Context >
template<typename T >
void dragon::Pool2dOp< Context >::MaxRunImpl ( )

◆ Reshape()

template<class Context >
void dragon::Pool2dOp< Context >::Reshape ( )

◆ RunOnDevice()

template<class Context >
void dragon::Pool2dOp< Context >::RunOnDevice ( )
overridevirtual

Implement the detailed execution.

Implements dragon::Operator< Context >.

Reimplemented in dragon::CuDNNPool2dOp< Context >.

Member Data Documentation

◆ c_

template<class Context >
int64_t dragon::Pool2dOp< Context >::c_
protected

◆ ceil_mode_

template<class Context >
bool dragon::Pool2dOp< Context >::ceil_mode_
protected

◆ global_pool_

template<class Context >
bool dragon::Pool2dOp< Context >::global_pool_
protected

◆ h_

template<class Context >
int64_t dragon::Pool2dOp< Context >::h_
protected

◆ kshape_

template<class Context >
vec64_t dragon::Pool2dOp< Context >::kshape_
protected

◆ mode_

template<class Context >
string dragon::Pool2dOp< Context >::mode_
protected

◆ n_

template<class Context >
int64_t dragon::Pool2dOp< Context >::n_
protected

◆ pad_l_

template<class Context >
vec64_t dragon::Pool2dOp< Context >::pad_l_
protected

◆ pad_r_

template<class Context >
vec64_t dragon::Pool2dOp< Context >::pad_r_
protected

◆ padding_

template<class Context >
string dragon::Pool2dOp< Context >::padding_
protected

◆ pool_h_

template<class Context >
int64_t dragon::Pool2dOp< Context >::pool_h_
protected

◆ pool_w_

template<class Context >
int64_t dragon::Pool2dOp< Context >::pool_w_
protected

◆ stride_

template<class Context >
vec64_t dragon::Pool2dOp< Context >::stride_
protected

◆ USE_OPERATOR_FUNCTIONS

template<class Context >
dragon::Pool2dOp< Context >::USE_OPERATOR_FUNCTIONS

◆ w_

template<class Context >
int64_t dragon::Pool2dOp< Context >::w_
protected

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