The given v should contain a single Tensor.
Package:
torch
50580

Exception Class:
RuntimeError
Raise code
def _validate_v(v, other, is_other_tuple):
# This assumes that other is the correct shape, and v should match
# Both are assumed to be tuples of Tensors
if len(other) != len(v):
if is_other_tuple:
raise RuntimeError("v is a tuple of invalid length: should be {} but got {}.".format(len(other), len(v)))
else:
raise RuntimeError("The given v should contain a single Tensor.")
for idx, (el_v, el_other) in enumerate(zip(v, other)):
if el_v.size() != el_other.size():
prepend = ""
if is_other_tuple:
prepend = "Entry {} in ".format(idx)
raise RuntimeError("{}v has invalid size: should be {} but got {}.".format(
Links to the raise (1)
https://github.com/pytorch/pytorch/blob/e56d3b023818f54553f2dc5d30b6b7aaf6b6a325/torch/autograd/functional.py#L84NO FIXES YET
Just press the button and we will add solution
to this exception as soon as possible
* As many users press the button, the faster we create a fix
Add a possible fix
Please authorize to post fix