class_docstr: Batch timing class.
  Use this class for tracking training and testing time/rate per batch or per sample.
  
  Keyword Arguments:
      rate {bool} -- Whether to report a rate (batches or samples per second) or a time (seconds
          per batch or sample). (default: {True})
      per_sample {bool} -- Whether to report times or rates per sample or per batch.
          (default: {True})
code: def __call__(self, y_pred, y):
      self.end = time.time()
      elapsed = self.end - self.start
      self.start = self.end
      self.end = None
  
      if self.per_sample:
          elapsed /= len(y_pred)
      if self.rate:
          elapsed = 1 / elapsed
  
      return torch.tensor(elapsed)
  
file_path: facenet-pytorch/models/utils/training.py
imports: import torch
  import numpy
  import time
label_desc: Use image node_id 2 for calling the BatchTimer obj's underlying member method code with example usage: obj.__call__(y_pred, y) and returns: torch