-
Notifications
You must be signed in to change notification settings - Fork 95
Closed
Description
Really happy that ChainRules now has a @non_differentiable macro! Unfortunately it includes all rand methods, which is a bit too restrictive... there was a similar discussion about this in FluxML/Zygote.jl#234 .
MWE:
using Random
using Zygote
struct Normal
μ
σ
end
Random.rand(d::Normal) = randn()*d.σ + d.μ
f(a,b) = rand(Normal(a,b))
gs = Zygote.gradient(f,2,2) # returns (nothing,nothing) with ChainRules > 0.7.15Metadata
Metadata
Assignees
Labels
No labels