未验证 提交 de2166c0 编写于 作者: H houj04 提交者: GitHub

[XPU] fix unit test of test_pad3d_op_xpu. (#51962)

上级 153351e1
...@@ -189,7 +189,7 @@ class XPUTestPad3dOp(XPUOpTestWrapper): ...@@ -189,7 +189,7 @@ class XPUTestPad3dOp(XPUOpTestWrapper):
value = 100 value = 100
input_data = np.random.rand(*input_shape).astype(self.dtype) input_data = np.random.rand(*input_shape).astype(self.dtype)
x = paddle.static.data( x = paddle.static.data(
name="x", shape=input_shape, dtype="float32" name="x", shape=input_shape, dtype=self.dtype
) )
result = F.pad( result = F.pad(
x=x, pad=pad, value=value, mode=mode, data_format="NCDHW" x=x, pad=pad, value=value, mode=mode, data_format="NCDHW"
...@@ -212,7 +212,7 @@ class XPUTestPad3dOp(XPUOpTestWrapper): ...@@ -212,7 +212,7 @@ class XPUTestPad3dOp(XPUOpTestWrapper):
mode = "reflect" mode = "reflect"
input_data = np.random.rand(*input_shape).astype(self.dtype) input_data = np.random.rand(*input_shape).astype(self.dtype)
x = paddle.static.data( x = paddle.static.data(
name="x", shape=input_shape, dtype="float32" name="x", shape=input_shape, dtype=self.dtype
) )
result1 = F.pad(x=x, pad=pad, mode=mode, data_format="NCDHW") result1 = F.pad(x=x, pad=pad, mode=mode, data_format="NCDHW")
result2 = F.pad(x=x, pad=pad, mode=mode, data_format="NDHWC") result2 = F.pad(x=x, pad=pad, mode=mode, data_format="NDHWC")
...@@ -240,7 +240,7 @@ class XPUTestPad3dOp(XPUOpTestWrapper): ...@@ -240,7 +240,7 @@ class XPUTestPad3dOp(XPUOpTestWrapper):
mode = "replicate" mode = "replicate"
input_data = np.random.rand(*input_shape).astype(self.dtype) input_data = np.random.rand(*input_shape).astype(self.dtype)
x = paddle.static.data( x = paddle.static.data(
name="x", shape=input_shape, dtype="float32" name="x", shape=input_shape, dtype=self.dtype
) )
result1 = F.pad(x=x, pad=pad, mode=mode, data_format="NCDHW") result1 = F.pad(x=x, pad=pad, mode=mode, data_format="NCDHW")
result2 = F.pad(x=x, pad=pad, mode=mode, data_format="NDHWC") result2 = F.pad(x=x, pad=pad, mode=mode, data_format="NDHWC")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册