No, the result is scalar, it is not gradient or hessian, it is just a function R^n -> R and we take derivatives wrt each variable one after another, like
grad_wtr_x_n( .. grad_wrt_x_0(f(x_0,..,x_n) .. ) - result is also a scalar function of (x_0..x_n)
each grad_x_i(…) is a scalar function.
Just taking gradients wrt single input one after another in a loop seems like a terrible idea, though I should test it first.