Open avik-pal opened 4 years ago
Although there's probably something to be said for letting functors work with @scalar_rule
if none of the parameters are differentiable, I suspect it's safest just to disallow them entirely.
To my mind @scalar_rule
should stick close to what DiffRules.jl allows and not do more.
Thus it should not permit functors,
and indeed the code is supposed to error for them.
https://github.com/JuliaDiff/ChainRulesCore.jl/blob/36b0449792da2b91fee2c6c30288174a2f3085d2/src/rule_definition_tools.jl#L89
I suspect we are not successfully capturing the f
, and thus are skipping that error message
Results in
UndefVarError: m not defined
.As per the docs, this should not work. @oxinabox pointed out on slack that this should lead to a more meaningful error message.