You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using asarray() in the torch backend, if called on a pre-existing tensor it will delete its autograd history by default (see https://pytorch.org/docs/stable/generated/torch.asarray.html). Consequently, one cannot compute gradients on functions that include asarray().
We need to use as_tensor() instead, or use asarray(*args, requires_grad=True).
The text was updated successfully, but these errors were encountered:
When using
asarray()
in the torch backend, if called on a pre-existing tensor it will delete its autograd history by default (see https://pytorch.org/docs/stable/generated/torch.asarray.html). Consequently, one cannot compute gradients on functions that includeasarray()
.We need to use
as_tensor()
instead, or useasarray(*args, requires_grad=True)
.The text was updated successfully, but these errors were encountered: