restating, your reply clarifies that giving ‘model’ as the explicit argument of the function tells zygote to take the gradient with respect to the parameters in model.
But what then is the purpose and meaning of the ‘model’ parameter that is passed gradient, this one
g = gradient(model → mse(model.(x),y), model)
Probably a different example would be better to explain. Suppose the function has two arguments,
h(x,y) = x+y
How do you get the gradient with respect to y?