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

[Cherry-pick] Polish custom operator overrided method impl (#32666) (#32674)

cherry-pick of #32666
上级 3c324f04
......@@ -246,7 +246,7 @@ class CustomOperator : public OperatorWithKernel {
* it can only be determined at runtime.
*/
framework::OpKernelType GetExpectedKernelType(
const framework::ExecutionContext& ctx) const {
const framework::ExecutionContext& ctx) const override {
return framework::OpKernelType(proto::VarType::RAW, ctx.GetPlace());
}
......@@ -257,7 +257,7 @@ class CustomOperator : public OperatorWithKernel {
*/
framework::OpKernelType GetKernelTypeForVar(
const std::string& var_name, const Tensor& tensor,
const OpKernelType& expected_kernel_type) {
const OpKernelType& expected_kernel_type) const override {
return OpKernelType(expected_kernel_type.data_type_,
expected_kernel_type.place_, tensor.layout());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册