Now, the obvious solution is to simply keep our inputs as Vector{Float64} . However, this becomes an issue if we want to fit more complex models where we need to keep this as Vector{Real} .
As far as my understanding goes, the problem arises from ReverseDiff incorrectly tracking these inputs when it shouldn't, and consequently the wrong method for increment_deriv!() being called.
Feel free to move this issue to ReverseDiff if you think this is more ReverseDiff package specific.
Hi everyone!
We stumbled upon an issue when fitting a
Turing
model usingReverseDiff
if the inputs areVector{Real}
.Minimal Working Example
Error Message:
In the case where our log_probabilities are
Vector{Real}
this results in the following error:Now, the obvious solution is to simply keep our inputs as
Vector{Float64}
. However, this becomes an issue if we want to fit more complex models where we need to keep this asVector{Real}
.As far as my understanding goes, the problem arises from
ReverseDiff
incorrectly tracking these inputs when it shouldn't, and consequently the wrong method forincrement_deriv!()
being called.Feel free to move this issue to
ReverseDiff
if you think this is moreReverseDiff
package specific.Many thanks for your help!