code: def _compute_tower_qps(
      num_examples: torch.Tensor, time_lapse: torch.Tensor
  ) -> torch.Tensor:
      return torch.where(
          time_lapse <= 0.0, 0.0, num_examples / time_lapse
      ).double()
  
file_path: torchrec/torchrec/metrics/tower_qps.py
imports: import time
  from typing import Any, cast, Dict, List, Optional, Type
  import torch
  import torch.distributed
  from torchrec.metrics.metrics_config import RecComputeMode, RecTaskInfo
  from torchrec.metrics.metrics_namespace import MetricName, MetricNamespace, MetricPrefix
  from torchrec.metrics.rec_metric import MetricComputationReport, RecMetric, RecMetricComputation, RecMetricException, RecModelOutput
label_desc: Use image node_id 1 for calling a global function with example usage: _compute_tower_qps(num_examples, time_lapse) and returns: torch