提交 a0d77533 编写于 作者: Y Yu Yang

Rename Ctor -> Constructor

Make code more clearer
上级 3e52343d
...@@ -274,7 +274,7 @@ class OpKernelRegistrar : public Registrar { ...@@ -274,7 +274,7 @@ class OpKernelRegistrar : public Registrar {
class _OpClass_##op_type##_ : public op_class { \ class _OpClass_##op_type##_ : public op_class { \
public: \ public: \
DEFINE_OP_CLONE_METHOD(_OpClass_##op_type##_); \ DEFINE_OP_CLONE_METHOD(_OpClass_##op_type##_); \
DEFINE_OP_CTOR(_OpClass_##op_type##_, op_class); \ DEFINE_OP_CONSTRUCTOR(_OpClass_##op_type##_, op_class); \
}; \ }; \
static ::paddle::framework::OpRegistrar<_OpClass_##op_type##_, \ static ::paddle::framework::OpRegistrar<_OpClass_##op_type##_, \
op_maker_class> \ op_maker_class> \
...@@ -294,7 +294,7 @@ class OpKernelRegistrar : public Registrar { ...@@ -294,7 +294,7 @@ class OpKernelRegistrar : public Registrar {
class _OpGradClass_##op_type##_ : public grad_op_class { \ class _OpGradClass_##op_type##_ : public grad_op_class { \
public: \ public: \
DEFINE_OP_CLONE_METHOD(_OpGradClass_##op_type##_); \ DEFINE_OP_CLONE_METHOD(_OpGradClass_##op_type##_); \
DEFINE_OP_CTOR(_OpGradClass_##op_type##_, grad_op_class); \ DEFINE_OP_CONSTRUCTOR(_OpGradClass_##op_type##_, grad_op_class); \
}; \ }; \
static ::paddle::framework::GradOpRegistrar<_OpGradClass_##op_type##_> \ static ::paddle::framework::GradOpRegistrar<_OpGradClass_##op_type##_> \
__op_gradient_registrar_##op_type##_##grad_op_type##__(#op_type, \ __op_gradient_registrar_##op_type##_##grad_op_type##__(#op_type, \
......
...@@ -118,7 +118,7 @@ class OperatorBase { ...@@ -118,7 +118,7 @@ class OperatorBase {
public: public:
std::string type_; std::string type_;
// NOTE: in case of OpGrad, inputs_ contains: // NOTE: in case of OpGrad, inputs_ contains:
// I (Inputs) // I (Inputs)opear
// O (Outputs) // O (Outputs)
// OG (Output Gradients) // OG (Output Gradients)
VarNameMap inputs_; VarNameMap inputs_;
...@@ -139,7 +139,7 @@ class OperatorBase { ...@@ -139,7 +139,7 @@ class OperatorBase {
// You can also use // You can also use
// using PARENT_CLASS::PARENT_CLASS; // using PARENT_CLASS::PARENT_CLASS;
// to use parent's constructor. // to use parent's constructor.
#define DEFINE_OP_CTOR(CLS, PARENT_CLS) \ #define DEFINE_OP_CONSTRUCTOR(CLS, PARENT_CLS) \
CLS(const std::string& type, const VarNameMap& inputs, \ CLS(const std::string& type, const VarNameMap& inputs, \
const VarNameMap& outputs, const paddle::framework::AttributeMap& attrs) \ const VarNameMap& outputs, const paddle::framework::AttributeMap& attrs) \
: PARENT_CLS(type, inputs, outputs, attrs) {} : PARENT_CLS(type, inputs, outputs, attrs) {}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册