You should set the requires_grad parameter to True only if you want to get the gradients for a given Tensor by reading it’s .grad field (or passing it to autograd.grad). So here I don’t think you want to set it.
I am not sure to understand your function. You have a return at the end of the first iteration of the loop? Also what does self.multi_order contains?