- **Array inputs that are being differentiated cannot be mutated**. This also applies to any "descendent" arrays that must be tracked (e.g. if `A` is an immutable input array, then `C = A * A` will also be immutable). If you try to perform `setindex!` on such arrays, an error will be thrown. In the future, this restriction might be lifted. Note that arrays explicitly constructed within the target function (e.g. via `ones`, `similar`, etc.) can be mutated, as well as output arrays used when taking the Jacobian of a function of the form `f!(output, input....).`
0 commit comments