Skip to content

Commit 5af7681

Browse files
committed
changes after review
1 parent ada7c31 commit 5af7681

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

paddle/fluid/operators/cast_op.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ class CastOp : public framework::OperatorWithKernel {
8787
int out_dtype = ctx.Attr<int>("out_dtype");
8888

8989
auto MKLDNNSupportsCast = [&]() -> bool {
90-
int dtype_fp32 = (int)framework::proto::VarType::FP32;
91-
int dtype_bf16 = (int)framework::proto::VarType::BF16;
90+
int dtype_fp32 = static_cast<int>(framework::proto::VarType::FP32);
91+
int dtype_bf16 = static_cast<int>(framework::proto::VarType::BF16);
9292

9393
if ((in_dtype != dtype_fp32 && in_dtype != dtype_bf16) or
9494
(out_dtype != dtype_fp32 && out_dtype != dtype_bf16))

python/paddle/fluid/tests/unittests/mkldnn/test_cast_mkldnn_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
from __future__ import print_function
1616

17-
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16, convert_uint16_to_float
1817
import unittest
1918
import numpy as np
2019

2120
import paddle
2221
import paddle.fluid.core as core
2322
import paddle.fluid as fluid
2423
from paddle.fluid import compiler, Program, program_guard
24+
from paddle.fluid.tests.unittests.op_test import OpTest, convert_float_to_uint16
2525

2626

2727
@unittest.skipIf(not core.supports_bfloat16(),

0 commit comments

Comments
 (0)