def train_batch(self, batch_info, data, target):
batch_info.optimizer.zero_grad()<EOL>loss = self.feed_batch(batch_info, data, target)<EOL>loss.backward()<EOL>if self.max_grad_norm is not None:<EOL><INDENT>batch_info['<STR_LIT>'] = torch.nn.utils.clip_grad_norm_(<EOL>filter(lambda p: p.requires_grad, self.model.parameters()),<EOL>max_norm=self.max_grad_norm<EOL>)<EOL><DEDENT>batch_info.optimizer.step()<EOL>
Train single batch of data