Skip to content

Commit efceccb

Browse files
committed
skip legalize when batch size is dynamic
1 parent 65fbc0a commit efceccb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/tvm/topi/cuda/conv2d_alter_op.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ def _conv2d_legalize(attrs, inputs, arg_types):
450450

451451
elif data_dtype in ["float16"]:
452452
if data_layout == "NHWC" and kernel_layout == "HWIO":
453+
if isinstance(data_tensor.shape[0], tvm.tir.expr.Any):
454+
# Skip legalize when the batch size is dynamic
455+
return None
456+
453457
batch = data_tensor.shape[0].value
454458
in_channel = data_tensor.shape[3].value
455459
out_channel = kernel_tensor.shape[3].value

0 commit comments

Comments
 (0)