未验证 提交 3ca700a9 编写于 作者: Z Zeng Jinle 提交者: GitHub

code clean, test=develop (#24060)

上级 35148d17
......@@ -32,10 +32,10 @@ const framework::Tensor* GetTensorFromVar(const framework::Variable& var) {
}
template <typename VarType>
static void PrepareDataImpl(
const platform::Place& place, const NameVarMap<VarType>& ins,
const framework::OperatorWithKernel& op,
const framework::OpKernelType& expected_kernel_key) {
static void PrepareData(const platform::Place& place,
const NameVarMap<VarType>& 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<VarBase>& ins,
const framework::OperatorWithKernel& op,
const framework::OpKernelType& expected_kernel_key) {
PrepareDataImpl<VarBase>(place, ins, op, expected_kernel_key);
}
void PreparedOp::PrepareData(
const platform::Place& place, const NameVarMap<VariableWrapper>& ins,
const framework::OperatorWithKernel& op,
const framework::OpKernelType& expected_kernel_key) {
PrepareDataImpl<VariableWrapper>(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<VarType>& ins,
place = dev_ctx->GetPlace();
}
PrepareDataImpl<VarType>(place, ins, op, expected_kernel_key);
PrepareData<VarType>(place, ins, op, expected_kernel_key);
return PreparedOp(op, ctx, kernel_iter->second, dev_ctx);
}
......
......@@ -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<VarBase>& in, const NameVarMap<VarBase>& out,
const framework::AttributeMap& attrs);
......@@ -56,16 +54,6 @@ class PreparedOp {
const NameVarMap<VariableWrapper>& outs,
const framework::AttributeMap& attrs);
static void PrepareData(const platform::Place& place,
const NameVarMap<VarBase>& ins,
const framework::OperatorWithKernel& op,
const framework::OpKernelType& expected_kernel_key);
static void PrepareData(const platform::Place& place,
const NameVarMap<VariableWrapper>& ins,
const framework::OperatorWithKernel& op,
const framework::OpKernelType& expected_kernel_key);
private:
const framework::OperatorBase& op_;
const framework::RuntimeContext& ctx_;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册