code: def _train_epoch(self, train_loader):
      self.model.train()
      total_loss = 0
      batch_idx = 0
      tqdm = None
      try:
          from tqdm import tqdm
  
          pbar = tqdm(total=len(train_loader))
      except ImportError:
          pass
      for x_batch, y_batch in train_loader:
          self.optimizer.zero_grad()
          yhat = self._forward(x_batch, y_batch)
          loss = self.criterion(yhat, y_batch)
          loss.backward()
          self.optimizer.step()
          total_loss += loss.item()
          batch_idx += 1
          if tqdm:
              pbar.set_description("Loss: {}".format(loss.item()))
              pbar.update(1)
      if tqdm:
          pbar.close()
      train_loss = total_loss / batch_idx
      return train_loss
  
imports: import torch
  from torch.utils.data import TensorDataset, DataLoader
  import types
  import numpy
  import math
  import pandas
  import tempfile
  import os
  from zoo.orca.automl.model.abstract import BaseModel, ModelBuilder
  from zoo.orca.automl.metrics import Evaluator
  from zoo.orca.automl.pytorch_utils import LR_NAME, DEFAULT_LR
label_desc: Use image node_id 10 for calling the PytorchBaseModel obj's underlying member method code with example usage: obj._train_epoch(train_loader) and returns: train_loss