class_docstr: A custom trainer whose training duration is based on wall clock time
  instead of epochs.
class_docstr_tok: ["A","custom","trainer","whose","training","duration","is","based","on","wall","clock","time","instead","of","epochs","."]
code: def __call__(
      self,
      net: nn.HybridBlock,
      train_iter: DataLoader,
      validation_iter: Optional[DataLoader] = None,
  ) -> None:
      logger.info("Start model training")
      net.initialize(ctx=self.ctx, init=self.init)
  
      with HybridContext(
          net=net,
          hybridize=self.hybridize,
          static_alloc=True,
          static_shape=True,
      ):
          self._train_loop(net, train_iter, validation_iter)
  
imports: import itertools
  import logging
  import time
  from typing import List, Optional
  import mxnet
  import numpy
  from gluonts.core.component import validated
  from gluonts.dataset.loader import DataLoader
  from gluonts.gluonts_tqdm import tqdm
  from gluonts.mx.trainer import Trainer
  from gluonts.mx.util import HybridContext
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.metric import ndarray
  from .callbacks import Callback, CallbackList
label_desc: Use image node_id 2 for calling the TimedTrainer obj's underlying member method code with example usage: obj.__call__(net, train_iter, validation_iter) without return types