class_docstr: Manages a PyTorch model for training.
class_docstr_tok: ["Manages","a","PyTorch","model","for","training","."]
code: def _train_loop(self, iterator, metric_meters, callbacks):
      for batch_idx, batch in enumerate(iterator):
          self.batch_idx = batch_idx
  
          self._train_batch(batch, callbacks=callbacks)
  
          metric_meters.update(
              self.metrics_stats,
              n=self.metrics_stats.pop(NUM_SAMPLES, 1),
          )
  
          del self.batch_idx
          del self.metrics_stats
          if self.stop:
              break
  
imports: from filelock import FileLock
  import logging
  import os
  import copy
  import tempfile
  import math
  import torch
  import torch.nn
  import numpy
  from torch.utils.data import DataLoader, IterableDataset
  from bigdl.orca.learn.metrics import Metric
  from bigdl.orca import OrcaContext
  from bigdl.orca.learn.pytorch import utils
  from bigdl.orca.learn.pytorch.utils import AverageMeterCollection, NUM_SAMPLES, get_batchsize, index_concatenate, split_predict_cols
  from bigdl.orca.learn.pytorch.core import BaseRunner
  from bigdl.dllib.utils.log4Error import invalidInputError
label_desc: Use image node_id 10 for calling the TorchRunner obj's underlying member method code with example usage: obj._train_loop(iterator, metric_meters, callbacks) without return types