diff --git a/paddle/fluid/imperative/prepared_operator.cc b/paddle/fluid/imperative/prepared_operator.cc index 4d283d142b1bb66b2f1f3aa7d7f96a848f977389..def5c860449214ad4a08fd69ff575b91d6f162a0 100644 --- a/paddle/fluid/imperative/prepared_operator.cc +++ b/paddle/fluid/imperative/prepared_operator.cc @@ -32,10 +32,10 @@ const framework::Tensor* GetTensorFromVar(const framework::Variable& var) { } template -static void PrepareDataImpl( - const platform::Place& place, const NameVarMap& ins, - const framework::OperatorWithKernel& op, - const framework::OpKernelType& expected_kernel_key) { +static void PrepareData(const platform::Place& place, + const NameVarMap& ins, + const framework::OperatorWithKernel& op, + const framework::OpKernelType& expected_kernel_key) { for (const auto& name_pair : ins) { for (const auto& var_base : name_pair.second) { const auto* tensor = GetTensorFromVar(var_base->Var()); @@ -63,20 +63,6 @@ static void PrepareDataImpl( } } -void PreparedOp::PrepareData( - const platform::Place& place, const NameVarMap& ins, - const framework::OperatorWithKernel& op, - const framework::OpKernelType& expected_kernel_key) { - PrepareDataImpl(place, ins, op, expected_kernel_key); -} - -void PreparedOp::PrepareData( - const platform::Place& place, const NameVarMap& ins, - const framework::OperatorWithKernel& op, - const framework::OpKernelType& expected_kernel_key) { - PrepareDataImpl(place, ins, op, expected_kernel_key); -} - PreparedOp::PreparedOp(const framework::OperatorBase& op, const framework::RuntimeContext& ctx, const framework::OperatorWithKernel::OpKernelFunc& func, @@ -122,7 +108,7 @@ PreparedOp PrepareOpImpl(const NameVarMap& ins, place = dev_ctx->GetPlace(); } - PrepareDataImpl(place, ins, op, expected_kernel_key); + PrepareData(place, ins, op, expected_kernel_key); return PreparedOp(op, ctx, kernel_iter->second, dev_ctx); } diff --git a/paddle/fluid/imperative/prepared_operator.h b/paddle/fluid/imperative/prepared_operator.h index 8ffc3eaf82f0386f75daabd8f9436feb55f68c40..bf02eebdbb6be6638592017b264f0ef5054537ff 100644 --- a/paddle/fluid/imperative/prepared_operator.h +++ b/paddle/fluid/imperative/prepared_operator.h @@ -47,8 +47,6 @@ class PreparedOp { const platform::Place& place, const framework::AttributeMap& attrs); - inline platform::DeviceContext* GetDeviceContext() const { return dev_ctx_; } - void Run(const NameVarMap& in, const NameVarMap& out, const framework::AttributeMap& attrs); @@ -56,16 +54,6 @@ class PreparedOp { const NameVarMap& outs, const framework::AttributeMap& attrs); - static void PrepareData(const platform::Place& place, - const NameVarMap& ins, - const framework::OperatorWithKernel& op, - const framework::OpKernelType& expected_kernel_key); - - static void PrepareData(const platform::Place& place, - const NameVarMap& ins, - const framework::OperatorWithKernel& op, - const framework::OpKernelType& expected_kernel_key); - private: const framework::OperatorBase& op_; const framework::RuntimeContext& ctx_;