In Zygote, why (model)->... in gradient

the function gradient must know what you would like to take the gradient with respect to. Typically, you’d like to take the gradient wrt the parameters of the model, which Zygote let’s you do by simply passing the entire model.

You could also take the gradient wrt, for instance, the input x if you would like.