training the grads[m]