I’m trying to do something like this, (I hope the snippet is enough although it’s incomplete)
prob_primitives = [(θ[i+1], p) for (i, p) in enumerate(primitives)]
where primitives is a Vector. However, using this code in a Zygote.gradient call results in an error MethodError: no method matching iterate(::Nothing).
I’ve tried this code as an alternative,
prob_primitives = collect(zip(θ[2:end], primitives))
collect constructs the array using mutation which is also unsupported.