Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a better error message when num_derivatives is too low #244

Open
ezyang opened this issue Sep 25, 2017 · 0 comments
Open

Give a better error message when num_derivatives is too low #244

ezyang opened this issue Sep 25, 2017 · 0 comments

Comments

@ezyang
Copy link
Owner

ezyang commented Sep 25, 2017

At the moment, if you set num_derivatives to something lower than the actual number of derivatives you compute, you'll get something like:

----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_jit.py", line 539, in test_mini_wlm
    z.sum().backward()
  File "/data/users/ezyang/onnx-pytorch/pytorch/torch/autograd/variable.py", line 158, in backward
    torch.autograd.backward(self, gradient, retain_graph, create_graph, retain_variables)
  File "/data/users/ezyang/onnx-pytorch/pytorch/torch/autograd/__init__.py", line 98, in backward
    variables, grad_variables, retain_graph)
RuntimeError: vector::_M_range_check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant