Skip to content

Commit 69969e5

Browse files
ezyangpytorchmergebot
authored andcommitted
Cast computation_node_input_size to int (pytorch#103677)
This bandaid fixes yolov3 with automatic_dynamic_shapes. A more proper fix probably is to figure out why when we have ``` TypeError: mkldnn_reorder_conv2d_weight(): argument 'input_size' (position 6) must be tuple of ints, but found element of type SymInt at pos 1 ``` where the SymInt is known to be constant, we aren't willing to coerce it to int. Signed-off-by: Edward Z. Yang <[email protected]> Pull Request resolved: pytorch#103677 Approved by: https://github.com/voznesenskym
1 parent bcf2bec commit 69969e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torch/_inductor/mkldnn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ def pack_module(gm: torch.fx.GraphModule):
295295
):
296296
continue
297297
else:
298-
computation_node_input_size = (
299-
node.args[0].meta.get("tensor_meta").shape
298+
computation_node_input_size = tuple(
299+
int(x) for x in node.args[0].meta.get("tensor_meta").shape
300300
)
301301
if any(size == 0 for size in computation_node_input_size):
302302
continue

0 commit comments

Comments
 (0)