Improved message to suppress errors in _dynamo/exc.py (#97345)

If user adds simply to their code:
```python
import torch

torch._dynamo.config.suppress_errors = True
```
they will get:
```
AttributeError: module 'torch' has no attribute '_dynamo'
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/97345
Approved by: https://github.com/zou3519, https://github.com/kit1980
This commit is contained in:
vfdev 2023-04-28 01:12:03 +00:00 committed by PyTorch MergeBot
parent b51f92ebda
commit 0692bdd95f

View File

@ -187,6 +187,7 @@ def augment_exc_message(exc, msg="\n"):
msg += (
"\n\n"
"You can suppress this exception and fall back to eager by setting:\n"
" import torch._dynamo\n"
" torch._dynamo.config.suppress_errors = True\n"
)