diff --git a/src/operators/feed_op.h b/src/operators/feed_op.h index 286b0076ef2b9ad806f141c4d6124f1233dc78dc..9b632034113bf5b627ba069a108f067b71a008b7 100644 --- a/src/operators/feed_op.h +++ b/src/operators/feed_op.h @@ -36,12 +36,12 @@ class FeedOp : public framework::OperatorBase { out_dims[0] = param_.BatchSize(); param_.Out()->Resize(out_dims); } + void Init() {} #ifdef PADDLE_MOBILE_FPGA - void RunImpl() const { fpga::PerformBypass(param_.FpgaArgs()); } - void Init() { + void RunImpl() const { const Tensor *input = param_.InputX(); - auto input_ptr = (const_cast(input))->mutable_data(); + auto input_ptr = input->data(); Tensor *output = param_.Out(); auto output_ptr = output->mutable_data(); fpga::BypassArgs args; @@ -52,12 +52,11 @@ class FeedOp : public framework::OperatorBase { args.image.height = input->dims()[2]; args.image.width = input->dims()[3]; args.output.address = output_ptr; - param_.SetFpgaArgs(args); + fpga::PerformBypass(args); } #else void RunImpl() const { param_.Out()->ShareDataWith(*param_.InputX()); } - void Init() {} #endif protected: diff --git a/src/operators/op_param.h b/src/operators/op_param.h index 23d7d49ba9dab88b1b9a9c5656ad006cce6826f8..af8d35c9ecfb217c71fc024722608d8df28b5090 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -665,16 +665,6 @@ class FeedParam : public OpParam { Tensor *input_x_; Tensor *out_; int batch_size; - -#ifdef PADDLE_MOBILE_FPGA - - private: - fpga::BypassArgs fpga_bypass_args; - - public: - const fpga::BypassArgs &FpgaArgs() const { return fpga_bypass_args; } - void SetFpgaArgs(const fpga::BypassArgs &args) { fpga_bypass_args = args; } -#endif }; class FetchParam : public OpParam { @@ -1133,7 +1123,6 @@ class FusionConvBNParam : public OpParam { FusionConvBNParam(const VariableNameMap &inputs, const VariableNameMap &outputs, const AttributeMap &attrs, const Scope &scope) { - axis_ = GetAttr("axis", attrs); filter_ = FilterFrom(inputs, scope); input_ = InputFrom(inputs, scope); output_y_ = OutputYFrom(outputs, scope); @@ -1150,8 +1139,6 @@ class FusionConvBNParam : public OpParam { // is_test_ = GetAttr("is_test", attrs); } - const int &Axis() const { return axis_; } - const Tensor *Input() const { return input_; } #ifdef PADDLE_MOBILE_FPGA @@ -1192,7 +1179,6 @@ class FusionConvBNParam : public OpParam { const Tensor *NewBias() const { return new_bias_; } protected: - int axis_; Tensor *input_; Tensor *output_y_; Tensor *filter_;