Add config toggle suggestions for data-dependent/dynamic output shape (#114337)

Fixes https://github.com/pytorch/pytorch/issues/114220

Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/114337
Approved by: https://github.com/aakhundov
This commit is contained in:
Edward Z. Yang
2024-01-05 06:13:07 -05:00
committed by PyTorch MergeBot
parent 53f8d17d1e
commit 0249c4a785
2 changed files with 11 additions and 3 deletions

View File

@ -1491,7 +1491,9 @@ def forward(self, x_1):
self.assertEqual(
dict(counters["graph_break"]),
{"dynamic shape operator: _torch_testing.numpy_nonzero.default": 1},
{
"dynamic shape operator: _torch_testing.numpy_nonzero.default; to enable, set torch._dynamo.config.capture_dynamic_output_shape_ops = True": 1 # noqa: B950
},
)
# pre-existing problem: torch.compile(dynamic=True) will, by default,