Skip to content

Commit

Permalink
normalized custom operator impl (#32666)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenwhql authored Apr 29, 2021
1 parent 10c493a commit 7a73692
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/framework/custom_operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand All @@ -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());
}
Expand Down

0 comments on commit 7a73692

Please sign in to comment.