diff --git a/src/operators/op_param.h b/src/operators/op_param.h index f11e6c37cd9d1aa3625240619e0e31ea6f4d5a0d..bb2355d80fc581ff4e4501030632628b33394d6d 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -343,20 +343,22 @@ class OpParam { #ifdef CONV_OP template -class ConvParam : OpParam { +class ConvParam : public OpParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: ConvParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const AttributeMap &attrs, const Scope &scope) { - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutputFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); + filter_ = OpParam::FilterFrom(inputs, scope); + input_ = OpParam::InputFrom(inputs, scope); + if (outputs.count("Output")) { + output_ = OpParam::OutputFrom(outputs, scope); + } + strides_ = OpParam::GetAttr>("strides", attrs); + paddings_ = OpParam::GetAttr>("paddings", attrs); + dilations_ = OpParam::GetAttr>("dilations", attrs); + groups = OpParam::GetAttr("groups", attrs); } const RType *Input() const { return input_; } @@ -1294,52 +1296,29 @@ using FusionFcReluParam = FusionFcParam; #endif template -class FusionConvAddParam : public OpParam { +class FusionConvAddParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionConvAddParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const AttributeMap &attrs, - const Scope &scope) { - bias_ = InputYFrom(inputs, scope); - axis_ = GetAttr("axis", attrs); - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); + const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + bias_ = OpParam::InputYFrom(inputs, scope); + axis_ = OpParam::GetAttr("axis", attrs); + output_ = OpParam::OutFrom(outputs, scope); } RType *Bias() const { return bias_; } const int &Axis() const { return axis_; } - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - protected: RType *bias_; int axis_; - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; #ifdef PADDLE_MOBILE_FPGA private: @@ -1366,58 +1345,33 @@ class FusionConvAddReluParam : public FusionConvAddParam { #endif #ifdef FUSION_CONVADDPRELU_OP -template -class FusionConvAddPReluParam : public OpParam { - typedef typename DtypeTensorTrait::gtype GType; - typedef typename DtypeTensorTrait::rtype RType; +template +class FusionConvAddPReluParam : public ConvParam { + typedef typename DtypeTensorTrait::gtype GType; + typedef typename DtypeTensorTrait::rtype RType; public: FusionConvAddPReluParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - alpha_ = InputAlphaFrom(inputs, scope); - mode_ = GetAttr("mode", attrs); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + alpha_ = OpParam::InputAlphaFrom(inputs, scope); + mode_ = OpParam::GetAttr("mode", attrs); framework::DDim dims = alpha_->dims(); - bias_ = InputYFrom(inputs, scope); - axis_ = GetAttr("axis", attrs); - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); + bias_ = OpParam::InputYFrom(inputs, scope); + axis_ = OpParam::GetAttr("axis", attrs); + output_ = OpParam::OutFrom(outputs, scope); } const RType *InputAlpha() const { return alpha_; } const std::string &Mode() const { return mode_; } RType *Bias() const { return bias_; } - const int &Axis() const { return axis_; } - - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - protected: RType *bias_; int axis_; - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *alpha_; std::string mode_; #ifdef PADDLE_MOBILE_FPGA @@ -1433,35 +1387,30 @@ class FusionConvAddPReluParam : public OpParam { #endif #ifdef FUSION_CONVADDADDPRELU_OP -template -class FusionConvAddAddPReluParam : public OpParam { - typedef typename DtypeTensorTrait::gtype GType; - typedef typename DtypeTensorTrait::rtype RType; +template +class FusionConvAddAddPReluParam : public ConvParam { + typedef typename DtypeTensorTrait::gtype GType; + typedef typename DtypeTensorTrait::rtype RType; public: FusionConvAddAddPReluParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - bias1_ = InputYFrom1(inputs, scope); - alpha_ = InputAlphaFrom(inputs, scope); - mode_ = GetAttr("mode", attrs); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + bias1_ = OpParam::InputYFrom1(inputs, scope); + alpha_ = OpParam::InputAlphaFrom(inputs, scope); + mode_ = OpParam::GetAttr("mode", attrs); framework::DDim dims = alpha_->dims(); - bias_ = InputYFrom(inputs, scope); - axis_ = GetAttr("axis", attrs); - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - keyOutput_ = getkey("addOut", inputs, 0); - keyX1_ = getkey("addX", inputs, 1); - keyY1_ = getkey("Y", inputs, 1); + bias_ = OpParam::InputYFrom(inputs, scope); + output_ = OpParam::OutFrom(outputs, scope); + axis_ = OpParam::GetAttr("axis", attrs); + keyOutput_ = OpParam::getkey("addOut", inputs, 0); + keyX1_ = OpParam::getkey("addX", inputs, 1); + keyY1_ = OpParam::getkey("Y", inputs, 1); if (keyX1_ == keyOutput_) { - bias1_ = InputYFrom1(inputs, scope); + bias1_ = OpParam::InputYFrom1(inputs, scope); } else if (keyY1_ == keyOutput_) { - bias1_ = InputXFrom1(inputs, scope); + bias1_ = OpParam::InputXFrom1(inputs, scope); } } const RType *InputAlpha() const { return alpha_; } @@ -1471,31 +1420,12 @@ class FusionConvAddAddPReluParam : public OpParam { RType *Bias() const { return bias_; } const int &Axis() const { return axis_; } - - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - protected: RType *bias_; int axis_; - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *alpha_; std::string mode_; RType *bias1_; @@ -1516,49 +1446,32 @@ class FusionConvAddAddPReluParam : public OpParam { #ifdef FUSION_CONVADDBNRELU_OP template -class FusionConvAddBNReluParam : public OpParam { +class FusionConvAddBNReluParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionConvAddBNReluParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - bias_ = InputYFrom(inputs, scope); - axis_ = GetAttr("axis", attrs); - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - // is_test_ = GetAttr("is_test", attrs); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + bias_ = OpParam::InputYFrom(inputs, scope); + axis_ = OpParam::GetAttr("axis", attrs); + output_ = OpParam::OutFrom(outputs, scope); + input_bias_ = OpParam::InputBiasFrom(inputs, scope); + input_mean_ = OpParam::InputMeanFrom(inputs, scope); + input_scale_ = OpParam::InputScaleFrom(inputs, scope); + input_variance_ = OpParam::InputVarianceFrom(inputs, scope); + epsilon_ = OpParam::GetAttr("epsilon", attrs); + momentum_ = OpParam::GetAttr("momentum", attrs); + // is_test_ = OpParam::GetAttr("is_test", attrs); } RType *Bias() const { return bias_; } const int &Axis() const { return axis_; } - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - const RType *InputBias() const { return input_bias_; } const RType *InputMean() const { return input_mean_; } @@ -1584,13 +1497,7 @@ class FusionConvAddBNReluParam : public OpParam { protected: RType *bias_; int axis_; - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *input_bias_; RType *input_mean_; RType *input_scale_; @@ -1614,57 +1521,40 @@ class FusionConvAddBNReluParam : public OpParam { #ifdef FUSION_CONVBNADDRELU_OP template -class FusionConvBNAddReluParam : public OpParam { +class FusionConvBNAddReluParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionConvBNAddReluParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - bias_ = InputYFrom(inputs, scope); - axis_ = GetAttr("axis", attrs); - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - keyBNY_ = getkey("BNY", inputs, 0); - keyX_ = getkey("X", inputs, 0); - keyY_ = getkey("Y", inputs, 0); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + bias_ = OpParam::InputYFrom(inputs, scope); + axis_ = OpParam::GetAttr("axis", attrs); + output_ = OpParam::OutFrom(outputs, scope); + input_bias_ = OpParam::InputBiasFrom(inputs, scope); + input_mean_ = OpParam::InputMeanFrom(inputs, scope); + input_scale_ = OpParam::InputScaleFrom(inputs, scope); + input_variance_ = OpParam::InputVarianceFrom(inputs, scope); + epsilon_ = OpParam::GetAttr("epsilon", attrs); + momentum_ = OpParam::GetAttr("momentum", attrs); + keyBNY_ = OpParam::getkey("BNY", inputs, 0); + keyX_ = OpParam::getkey("X", inputs, 0); + keyY_ = OpParam::getkey("Y", inputs, 0); if (keyX_ == keyBNY_) { - bias_ = InputYFrom(inputs, scope); + bias_ = OpParam::InputYFrom(inputs, scope); } else if (keyY_ == keyBNY_) { - bias_ = InputXFrom(inputs, scope); + bias_ = OpParam::InputXFrom(inputs, scope); } - // is_test_ = GetAttr("is_test", attrs); + // is_test_ = OpParam::GetAttr("is_test", attrs); } RType *Bias() const { return bias_; } const int &Axis() const { return axis_; } - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - const RType *InputBias() const { return input_bias_; } const RType *InputMean() const { return input_mean_; } @@ -1690,13 +1580,7 @@ class FusionConvBNAddReluParam : public OpParam { protected: RType *bias_; int axis_; - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *input_bias_; RType *input_mean_; RType *input_scale_; @@ -1723,44 +1607,26 @@ class FusionConvBNAddReluParam : public OpParam { #ifdef FUSION_CONVBN_OP template -class FusionConvBNParam : public OpParam { +class FusionConvBNParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionConvBNParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const AttributeMap &attrs, - const Scope &scope) { - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_y_ = OutputYFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - // is_test_ = GetAttr("is_test", attrs); + const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + output_y_ = OpParam::OutputYFrom(outputs, scope); + input_bias_ = OpParam::InputBiasFrom(inputs, scope); + input_mean_ = OpParam::InputMeanFrom(inputs, scope); + input_scale_ = OpParam::InputScaleFrom(inputs, scope); + input_variance_ = OpParam::InputVarianceFrom(inputs, scope); + epsilon_ = OpParam::GetAttr("epsilon", attrs); + momentum_ = OpParam::GetAttr("momentum", attrs); + // is_test_ = OpParam::GetAttr("is_test", attrs); } - - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_y_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - const RType *InputBias() const { return input_bias_; } const RType *InputMean() const { return input_mean_; } @@ -1784,13 +1650,7 @@ class FusionConvBNParam : public OpParam { const RType *NewBias() const { return new_bias_; } protected: - RType *input_; RType *output_y_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *input_bias_; RType *input_mean_; RType *input_scale_; @@ -1814,49 +1674,32 @@ class FusionConvBNParam : public OpParam { #ifdef FUSION_CONVADDBN_OP template -class FusionConvAddBNParam : public OpParam { +class FusionConvAddBNParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionConvAddBNParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - bias_ = InputYFrom(inputs, scope); - axis_ = GetAttr("axis", attrs); - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_y_ = OutputYFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - // is_test_ = GetAttr("is_test", attrs); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + bias_ = OpParam::InputYFrom(inputs, scope); + axis_ = OpParam::GetAttr("axis", attrs); + output_y_ = OpParam::OutputYFrom(outputs, scope); + input_bias_ = OpParam::InputBiasFrom(inputs, scope); + input_mean_ = OpParam::InputMeanFrom(inputs, scope); + input_scale_ = OpParam::InputScaleFrom(inputs, scope); + input_variance_ = OpParam::InputVarianceFrom(inputs, scope); + epsilon_ = OpParam::GetAttr("epsilon", attrs); + momentum_ = OpParam::GetAttr("momentum", attrs); + // is_test_ = OpParam::GetAttr("is_test", attrs); } RType *Bias() const { return bias_; } const int &Axis() const { return axis_; } - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_y_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - const RType *InputBias() const { return input_bias_; } const RType *InputMean() const { return input_mean_; } @@ -1882,13 +1725,7 @@ class FusionConvAddBNParam : public OpParam { protected: RType *bias_; int axis_; - RType *input_; RType *output_y_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *input_bias_; RType *input_mean_; RType *input_scale_; @@ -1912,44 +1749,26 @@ class FusionConvAddBNParam : public OpParam { #ifdef FUSION_DWCONVBNRELU_OP template -class FusionDWConvBNReluParam : public OpParam { +class FusionDWConvBNReluParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionDWConvBNReluParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - // is_test_ = GetAttr("is_test", attrs); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + output_ = OpParam::OutFrom(outputs, scope); + input_bias_ = OpParam::InputBiasFrom(inputs, scope); + input_mean_ = OpParam::InputMeanFrom(inputs, scope); + input_scale_ = OpParam::InputScaleFrom(inputs, scope); + input_variance_ = OpParam::InputVarianceFrom(inputs, scope); + epsilon_ = OpParam::GetAttr("epsilon", attrs); + momentum_ = OpParam::GetAttr("momentum", attrs); + // is_test_ = OpParam::GetAttr("is_test", attrs); } - - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - const RType *InputBias() const { return input_bias_; } const RType *InputMean() const { return input_mean_; } @@ -1973,13 +1792,7 @@ class FusionDWConvBNReluParam : public OpParam { const RType *NewBias() const { return new_bias_; } protected: - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *input_bias_; RType *input_mean_; RType *input_scale_; @@ -1995,45 +1808,26 @@ class FusionDWConvBNReluParam : public OpParam { #ifdef FUSION_CONVBNRELU_OP template -class FusionConvBNReluParam : public OpParam { +class FusionConvBNReluParam : public ConvParam { typedef typename DtypeTensorTrait::gtype GType; typedef typename DtypeTensorTrait::rtype RType; public: FusionConvBNReluParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - filter_ = FilterFrom(inputs, scope); - input_ = InputFrom(inputs, scope); - output_ = OutFrom(outputs, scope); - - strides_ = GetAttr>("strides", attrs); - paddings_ = GetAttr>("paddings", attrs); - dilations_ = GetAttr>("dilations", attrs); - groups = GetAttr("groups", attrs); - input_bias_ = InputBiasFrom(inputs, scope); - input_mean_ = InputMeanFrom(inputs, scope); - input_scale_ = InputScaleFrom(inputs, scope); - input_variance_ = InputVarianceFrom(inputs, scope); - epsilon_ = GetAttr("epsilon", attrs); - momentum_ = GetAttr("momentum", attrs); - // is_test_ = GetAttr("is_test", attrs); + const AttributeMap &attrs, const Scope &scope) + : ConvParam(inputs, outputs, attrs, scope) { + output_ = OpParam::OutFrom(outputs, scope); + input_bias_ = OpParam::InputBiasFrom(inputs, scope); + input_mean_ = OpParam::InputMeanFrom(inputs, scope); + input_scale_ = OpParam::InputScaleFrom(inputs, scope); + input_variance_ = OpParam::InputVarianceFrom(inputs, scope); + epsilon_ = OpParam::GetAttr("epsilon", attrs); + momentum_ = OpParam::GetAttr("momentum", attrs); + // is_test_ = OpParam::GetAttr("is_test", attrs); } - - const RType *Input() const { return input_; } - - const RType *Filter() const { return filter_; } - RType *Output() const { return output_; } - const vector &Strides() const { return strides_; } - - const vector &Paddings() const { return paddings_; } - - const vector &Dilations() const { return dilations_; } - - const int &Groups() const { return groups; } - const RType *InputBias() const { return input_bias_; } const RType *InputMean() const { return input_mean_; } @@ -2057,13 +1851,7 @@ class FusionConvBNReluParam : public OpParam { const RType *NewBias() const { return new_bias_; } protected: - RType *input_; RType *output_; - RType *filter_; - vector strides_; - vector paddings_; - vector dilations_; - int groups; RType *input_bias_; RType *input_mean_; RType *input_scale_;