code: def compute_time_eval(model):
      """Computes precise model forward test time using dummy data."""
      # Use eval mode
      model.eval()
      # Generate a dummy mini-batch and copy data to GPU
      im_size, batch_size = cfg.TRAIN.IM_SIZE, int(
          cfg.TEST.BATCH_SIZE / cfg.NUM_GPUS
      )
      inputs = torch.zeros(batch_size, 3, im_size, im_size).cuda(
          non_blocking=False
      )
      # Compute precise forward pass time
      timer = Timer()
      total_iter = cfg.PREC_TIME.NUM_ITER + cfg.PREC_TIME.WARMUP_ITER
      for cur_iter in range(total_iter):
          # Reset the timers after the warmup phase
          if cur_iter == cfg.PREC_TIME.WARMUP_ITER:
              timer.reset()
          # Forward
          timer.tic()
          with amp.autocast(enabled=cfg.TRAIN.MIXED_PRECISION):
              model(inputs)
          torch.cuda.synchronize()
          timer.toc()
      return timer.average_time
  
file_path: pycls/pycls/core/benchmark.py
imports: import pycls.core.logging
  import pycls.core.net
  import pycls.datasets.loader
  import torch
  import torch.cuda.amp
  from pycls.core.config import cfg
  from pycls.core.timer import Timer
label_desc: Use image node_id 1 for calling a global function with example usage: compute_time_eval(model) and returns: timer