EnzymeAD / Enzyme.jl

Julia bindings for the Enzyme automatic differentiator
https://enzyme.mit.edu
MIT License
443 stars 62 forks source link

Try narrowing inactive rules for `rand` #1388

Closed gaurav-arya closed 5 months ago

gaurav-arya commented 5 months ago

Addresses #1387

These new rules could potentially be too narrow for some cases. Also, for reference, here are the ones in ChainRules.jl: https://github.com/JuliaDiff/ChainRules.jl/blob/f9f0722558e065ee8bbdf042c2d99a9d56ba0070/src/rulesets/Random/random.jl#L15-L25. It seemed like we might not need some of them, and also the generic rand! ones there would be dangerous for Enzyme when differentiating parameter-dependent mutable sampling.