Add flexible array auto-diff-ing