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
rand is currently flagged as a @nograd. While this is probably appropriate for the methods of rand one finds in Base, it's certainly not for things in Distributions. For example:
Zygote.gradient(x->rand(Normal(x, 1)), x)
Here the gradient w.r.t. x definitely shouldn't be zero in the general case.
I would suggest that @nograd should be extended slightly to allow it to be applied only to specific methods of function.
The text was updated successfully, but these errors were encountered:
@nograd is more-or-less a hack that I added back when everything was segfaulting, so simple examples would work. As you point out, it's basically never useful in its current form since it's almost always overly general.
Feel free to delete the @nograd usages entirely where they don't break the tests, or otherwise to just add more sensible definitions.
rand
is currently flagged as a@nograd
. While this is probably appropriate for the methods ofrand
one finds inBase
, it's certainly not for things inDistributions
. For example:Here the gradient w.r.t.
x
definitely shouldn't be zero in the general case.I would suggest that
@nograd
should be extended slightly to allow it to be applied only to specific methods of function.The text was updated successfully, but these errors were encountered: