def optimizer_step(self, batch_info, device, model, rollout):
batch_info.optimizer.zero_grad()<EOL>batch_result = self.calculate_gradient(batch_info=batch_info, device=device, model=model, rollout=rollout)<EOL>clip_gradients(batch_result, model, self.max_grad_norm)<EOL>batch_info.optimizer.step(closure=None)<EOL>self.post_optimization_step(batch_info, device, model, rollout)<EOL>return batch_result<EOL>
Single optimization step for a model