code: def train_one_epoch(self):
      self.model.train()
      logger = OccasionalLogger()
  
      num_batches = len(self.train_loader)
      for i, batch in enumerate(self.train_loader, start=1):
          mix = batch.mix.to(self.device)
          src = batch.src.to(self.device)
          mask = batch.mask.to(self.device)
  
          estimate = self.model(mix)
  
          si_snri, sdri = si_sdr_improvement(estimate, src, mix, mask)
          si_snri = si_snri.mean()
          sdri = sdri.mean()
  
          loss = -si_snri
          self.optimizer.zero_grad()
          loss.backward()
          torch.nn.utils.clip_grad_norm_(
              self.model.parameters(), self.grad_clip, norm_type=2.0
          )
          self.optimizer.step()
  
          metric = Metric(si_snri.item(), sdri.item())
          logger.log(
              metric, progress=i / num_batches, force=i == num_batches
          )
  
          if self.debug:
              break
  
file_path: audio/examples/source_separation/conv_tasnet/trainer.py
imports: import time
  from collections import namedtuple
  from typing import Tuple
  import torch
  import torch.distributed
  from utils import dist_utils, metrics
label_desc: Use image node_id 2 for calling the Trainer obj's underlying member method code with example usage: obj.train_one_epoch() without return types