未验证 提交 4d413d02 编写于 作者: C Chen Weihang 提交者: GitHub

revert cached kernel context removing (#39055)

上级 0617a3ed
......@@ -409,6 +409,8 @@ void VarBase::_CopyGradientFrom(const VarBase& src) {
}
}
pten::KernelContext OpBase::pt_kernel_context_;
void OpBase::SetType(const std::string& type) {
op_ = framework::OpRegistry::CreateOp(type, {}, {}, {}, false);
}
......
......@@ -210,6 +210,9 @@ class OpBase {
std::unique_ptr<framework::OperatorBase> op_;
platform::Place place_;
size_t id_{-1UL};
// In order to reduce the compatibility phase
// performance overhead, temporarily cache KernelContext
static pten::KernelContext pt_kernel_context_;
std::vector<std::shared_ptr<std::function<void()>>> void_function_post_hooks_;
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册