diff --git a/torch/autograd/anomaly_mode.py b/torch/autograd/anomaly_mode.py index 97def2dea3d0..05f88dbbe81a 100644 --- a/torch/autograd/anomaly_mode.py +++ b/torch/autograd/anomaly_mode.py @@ -7,9 +7,10 @@ class detect_anomaly(object): r"""Context-manager that enable anomaly detection for the autograd engine. This does two things: + - Running the forward pass with detection enabled will allow the backward - pass to print the traceback of the forward operation that created the failing - backward function. + pass to print the traceback of the forward operation that created the failing + backward function. - Any backward computation that generate "nan" value will raise an error. .. warning::