未验证 提交 78af100c 编写于 作者: Z zhulei 提交者: GitHub

fix test of affine_grid with rocm (#32047)

* fix test of affine_grid with rocm

* fix test of affine_grid with rocm
上级 b17e36a4
......@@ -9260,6 +9260,9 @@ def affine_grid(theta, out_shape, name=None):
'affine_grid')
else:
attrs['output_shape'] = out_shape
if core.is_compiled_with_rocm():
# ROCM platform do not have MIOPEN kernel for affine_grid
attrs['use_cudnn'] = False
helper.append_op(
type='affine_grid',
......
......@@ -83,6 +83,8 @@ class TestAffineGridOpCase1(TestAffineGridOp):
self.output_shape = np.array([20, 2, 5, 7]).astype("int32")
self.dynamic_shape = True
self.use_cudnn = True
if paddle.fluid.core.is_compiled_with_rocm():
self.use_cudnn = False # ROCM platform do not have MIOPEN kernel for affine_grid
self.align_corners = True
......
......@@ -119,6 +119,8 @@ def affine_grid(theta, out_shape, align_corners=True, name=None):
use_cudnn = True
else:
use_cudnn = False
if core.is_compiled_with_rocm():
use_cudnn = False # ROCM platform do not have MIOPEN kernel for affine_grid
if not (isinstance(out_shape, list) or isinstance(out_shape, tuple) or \
isinstance(out_shape, Variable)):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册