Skip to content

Commit

Permalink
Cast computation_node_input_size to int (#103677)
Browse files Browse the repository at this point in the history
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 <ezyang@meta.com>

Pull Request resolved: #103677
Approved by: https://github.com/voznesenskym
  • Loading branch information
ezyang authored and pytorchmergebot committed Jun 16, 2023
1 parent bcf2bec commit 69969e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torch/_inductor/mkldnn.py
Expand Up @@ -295,8 +295,8 @@ def pack_module(gm: torch.fx.GraphModule):
):
continue
else:
computation_node_input_size = (
node.args[0].meta.get("tensor_meta").shape
computation_node_input_size = tuple(
int(x) for x in node.args[0].meta.get("tensor_meta").shape
)
if any(size == 0 for size in computation_node_input_size):
continue
Expand Down

0 comments on commit 69969e5

Please sign in to comment.