提交 e47c2735 编写于 作者: Z zhaojiaying01

add PADDLE_MOBILE_CL macro in fetch_op.h

上级 0de1f171
......@@ -24,6 +24,7 @@ namespace operators {
using std::string;
template <typename DeviceType, typename T>
#ifdef PADDLE_MOBILE_CL
class FetchOp
: public framework::OperatorWithKernel<DeviceType, FetchParam<DeviceType>,
FetchKernel<DeviceType, T>> {
......@@ -34,12 +35,26 @@ class FetchOp
: framework::OperatorWithKernel<DeviceType, FetchParam<DeviceType>,
FetchKernel<DeviceType, T>>(
type, inputs, outputs, attrs, scope) {}
#else
class FetchOp : public framework::OperatorBase<DeviceType> {
public:
FetchOp(const string &type, const VariableNameMap &inputs,
const VariableNameMap &outputs, const framework::AttributeMap attrs,
std::shared_ptr<framework::Scope> scope)
: framework::OperatorBase<DeviceType>(type, inputs, outputs, attrs,
scope),
param_(inputs, outputs, attrs, *scope) {}
void Init() {}
#endif
void InferShape() const override;
void RunImpl() override;
protected:
#ifndef PADDLE_MOBILE_CL
FetchParam<DeviceType> param_;
#endif
};
} // namespace operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册