From 8c19d7aa2f89a38b3a68e53c73d88af16a3de8ce Mon Sep 17 00:00:00 2001 From: ronnywang <524019753@qq.com> Date: Sun, 21 Mar 2021 15:42:58 +0800 Subject: [PATCH] [ROCM] fix test_conv2d_transpose_op (#31749) --- paddle/fluid/operators/conv_transpose_cudnn_op.cu | 4 ++-- .../paddle/fluid/tests/unittests/test_conv2d_transpose_op.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/conv_transpose_cudnn_op.cu b/paddle/fluid/operators/conv_transpose_cudnn_op.cu index 5781dd18b7b..a712d31cf7e 100644 --- a/paddle/fluid/operators/conv_transpose_cudnn_op.cu +++ b/paddle/fluid/operators/conv_transpose_cudnn_op.cu @@ -202,7 +202,7 @@ class CUDNNConvTransposeOpKernel : public framework::OpKernel { int iwo_groups = groups; int c_groups = 1; -#if CUDNN_VERSION_MIN(7, 0, 1) +#if defined(PADDLE_WITH_HIP) || CUDNN_VERSION_MIN(7, 0, 1) iwo_groups = 1; c_groups = groups; groups = 1; @@ -452,7 +452,7 @@ class CUDNNConvTransposeGradOpKernel : public framework::OpKernel { int iwo_groups = groups; int c_groups = 1; -#if CUDNN_VERSION_MIN(7, 0, 1) +#if defined(PADDLE_WITH_HIP) || CUDNN_VERSION_MIN(7, 0, 1) iwo_groups = 1; c_groups = groups; groups = 1; diff --git a/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py b/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py index fb6058c0f03..4e582d74c24 100644 --- a/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py +++ b/python/paddle/fluid/tests/unittests/test_conv2d_transpose_op.py @@ -116,7 +116,7 @@ def conv2dtranspose_forward_naive(input_, filter_, attrs): class TestConv2DTransposeOp(OpTest): def setUp(self): # init as conv transpose - self.dtype = np.float64 + self.dtype = np.float32 if core.is_compiled_with_rocm() else np.float64 self.need_check_grad = True self.is_test = False self.use_cudnn = False -- GitLab