diff --git a/python/tvm/topi/nn/conv2d_transpose.py b/python/tvm/topi/nn/conv2d_transpose.py index b351af991ae6f..5638d3d77fd28 100644 --- a/python/tvm/topi/nn/conv2d_transpose.py +++ b/python/tvm/topi/nn/conv2d_transpose.py @@ -301,8 +301,8 @@ def conv2d_transpose_legalize(attrs, inputs, types): data, kernel = inputs kernel_layout = attrs["kernel_layout"] - target = tvm.target.Target.current(allow_none=False) - if "cudnn" in target.libs: + target = tvm.target.Target.current(allow_none=True) + if target and "cudnn" in target.libs: # cuDNN backend can directly operate on NHWC layout. return None