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

#include <conv_op_base.h>

Inheritance diagram for dragon::ConvOpBase< Context >:
dragon::Operator< Context > dragon::OperatorBase dragon::Conv2dOp< Context > dragon::ConvTranspose2dOp< Context > dragon::DepthwiseConv2dOp< Context > dragon::Conv2dGradientOp< Context > dragon::CuDNNConv2dOp< Context > dragon::ConvTranspose2dGradientOp< Context > dragon::CuDNNConvTranspose2dOp< Context > dragon::CuDNNDepthwiseConv2dOp< Context > dragon::DepthwiseConv2dGradientOp< Context > dragon::CuDNNConv2dGradientOp< Context > dragon::CuDNNDepthwiseConv2dGradientOp< Context > dragon::CuDNNConvTranspose2dGradientOp< Context >

Public Member Functions

 ConvOpBase (const OperatorDef &def, Workspace *ws)
 
 DECLARE_ARGS_WITH_DESC (int64_t, output_shape)
 
 DECLARE_ARGS_WITH_DESC (int64_t, output_padding)
 
void Setup (int num_axes)
 
void Reshape (bool backward=false)
 
virtual bool HasBias ()=0
 
virtual bool Transposed ()=0
 
template<typename T >
void Wx (const T *, const T *, T *, bool)
 
template<typename T >
void Pb (const T *, T *)
 
template<typename T >
void Dx (const T *, const T *, T *)
 
template<typename T >
void Dw (const T *, const T *, T *, bool)
 
template<typename T >
void Db (const T *, T *)
 
- 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...
 
virtual void RunOnDevice ()=0
 Implement the detailed execution. 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
 
vec64_t kshape_
 
vec64_t stride_
 
vec64_t pad_l_
 
vec64_t pad_r_
 
vec64_t dilation_
 
vec64_t in_shape_
 
vec64_t out_shape_
 
vec64_t x_shape_
 
vec64_t y_shape_
 
vec64_t w_shape_
 
vec64_t b_shape_
 
string padding_
 
int64_t is_1x1_
 
int64_t num_output_
 
int64_t group_
 
int64_t axis_
 
int64_t num_axes_
 
int64_t channels_
 
int64_t out_dim_
 
int64_t conv_in_channels_
 
int64_t conv_out_channels_
 
int64_t conv_out_dim_
 
int64_t kernel_dim_
 
int64_t col_dim_
 
int64_t col_ofs_
 
int64_t output_ofs_
 
int64_t w_ofs_
 
int64_t x_ofs_
 
int64_t y_ofs_
 

Additional Inherited Members

- Public Types inherited from dragon::OperatorBase
typedef Map< string, vector< OperatorBase * > > SubGraph
 
- 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...
 

Constructor & Destructor Documentation

◆ ConvOpBase()

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

Member Function Documentation

◆ Db()

template<class Context >
template<typename T >
template void dragon::ConvOpBase< Context >::Db ( const T *  ,
T *   
)

◆ DECLARE_ARGS_WITH_DESC() [1/2]

template<class Context >
dragon::ConvOpBase< Context >::DECLARE_ARGS_WITH_DESC ( int64_t  ,
output_shape   
)

◆ DECLARE_ARGS_WITH_DESC() [2/2]

template<class Context >
dragon::ConvOpBase< Context >::DECLARE_ARGS_WITH_DESC ( int64_t  ,
output_padding   
)

◆ Dw()

template<class Context >
template<typename T >
template void dragon::ConvOpBase< Context >::Dw ( const T *  ,
const T *  ,
T *  ,
bool   
)

◆ Dx()

template<class Context >
template<typename T >
template void dragon::ConvOpBase< Context >::Dx ( const T *  ,
const T *  ,
T *   
)

◆ HasBias()

template<class Context >
virtual bool dragon::ConvOpBase< Context >::HasBias ( )
pure virtual

◆ Pb()

template<class Context >
template<typename T >
template void dragon::ConvOpBase< Context >::Pb ( const T *  ,
T *   
)

◆ Reshape()

template<class Context >
void dragon::ConvOpBase< Context >::Reshape ( bool  backward = false)

◆ Setup()

template<class Context >
void dragon::ConvOpBase< Context >::Setup ( int  num_axes)

◆ Transposed()

template<class Context >
virtual bool dragon::ConvOpBase< Context >::Transposed ( )
pure virtual

◆ Wx()

template<class Context >
template<typename T >
template void dragon::ConvOpBase< Context >::Wx ( const T *  ,
const T *  ,
T *  ,
bool   
)

Member Data Documentation

◆ axis_

template<class Context >
int64_t dragon::ConvOpBase< Context >::axis_

◆ b_shape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::b_shape_

◆ channels_

template<class Context >
int64_t dragon::ConvOpBase< Context >::channels_

◆ col_dim_

template<class Context >
int64_t dragon::ConvOpBase< Context >::col_dim_

◆ col_ofs_

template<class Context >
int64_t dragon::ConvOpBase< Context >::col_ofs_

◆ conv_in_channels_

template<class Context >
int64_t dragon::ConvOpBase< Context >::conv_in_channels_

◆ conv_out_channels_

template<class Context >
int64_t dragon::ConvOpBase< Context >::conv_out_channels_

◆ conv_out_dim_

template<class Context >
int64_t dragon::ConvOpBase< Context >::conv_out_dim_

◆ dilation_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::dilation_

◆ group_

template<class Context >
int64_t dragon::ConvOpBase< Context >::group_

◆ in_shape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::in_shape_

◆ is_1x1_

template<class Context >
int64_t dragon::ConvOpBase< Context >::is_1x1_

◆ kernel_dim_

template<class Context >
int64_t dragon::ConvOpBase< Context >::kernel_dim_

◆ kshape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::kshape_

◆ num_axes_

template<class Context >
int64_t dragon::ConvOpBase< Context >::num_axes_

◆ num_output_

template<class Context >
int64_t dragon::ConvOpBase< Context >::num_output_

◆ out_dim_

template<class Context >
int64_t dragon::ConvOpBase< Context >::out_dim_

◆ out_shape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::out_shape_

◆ output_ofs_

template<class Context >
int64_t dragon::ConvOpBase< Context >::output_ofs_

◆ pad_l_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::pad_l_

◆ pad_r_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::pad_r_

◆ padding_

template<class Context >
string dragon::ConvOpBase< Context >::padding_

◆ stride_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::stride_

◆ USE_OPERATOR_FUNCTIONS

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

◆ w_ofs_

template<class Context >
int64_t dragon::ConvOpBase< Context >::w_ofs_

◆ w_shape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::w_shape_

◆ x_ofs_

template<class Context >
int64_t dragon::ConvOpBase< Context >::x_ofs_

◆ x_shape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::x_shape_

◆ y_ofs_

template<class Context >
int64_t dragon::ConvOpBase< Context >::y_ofs_

◆ y_shape_

template<class Context >
vec64_t dragon::ConvOpBase< Context >::y_shape_

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