gaurav-arya / StochasticAD.jl

Research package for automatic differentiation of programs containing discrete randomness.
MIT License
199 stars 16 forks source link

Type checking for propagate kwargs. #133

Open GuusAvis opened 1 month ago

GuusAvis commented 1 month ago

Added type testing for some kwargs in propagate, and adjusted a test that I think was already failing because of a wrong type but now it no longer fails quietly.

This is basically the same as https://github.com/gaurav-arya/StochasticAD.jl/pull/126, but applied to the changes of #132 (where an extra kwarg was introduced) and with a fix of the test.

Unfortunately is seems that the changes are triggering the failing of some other tests. I think the problem is that now, in case keep_deltas isa Val{true} but keep_triples isa Val{false}, propagate sometimes returns a Dual type instead of a StochasticTriple type. The test expects the latter though. I'm not entirely sure what the intended behavior is though so I won't make any further changes without further discussion.