code: def reduce_metrics(cls, logging_outputs) -> None:
      super().reduce_metrics(logging_outputs)
      latency = sum(log.get("latency", 0) for log in logging_outputs)
      delays_var = sum(
          log.get("delays_var", 0) for log in logging_outputs
      )
      latency_loss = sum(
          log.get("latency_loss", 0) for log in logging_outputs
      )
      nsentences = sum(
          log.get("nsentences", 0) for log in logging_outputs
      )
      metrics.log_scalar(
          "latency", latency.float() / nsentences, nsentences, round=3
      )
      metrics.log_scalar(
          "delays_var", delays_var / nsentences, nsentences, round=3
      )
      metrics.log_scalar(
          "latency_loss", latency_loss / nsentences, nsentences, round=3
      )
  
file_path: fairseq/fairseq/criterions/label_smoothed_cross_entropy_latency_augmented.py
imports: from dataclasses import dataclass, field
  import torch
  from fairseq import utils
  from fairseq.logging import metrics
  from fairseq.criterions import register_criterion
  from fairseq.criterions.label_smoothed_cross_entropy import LabelSmoothedCrossEntropyCriterion, LabelSmoothedCrossEntropyCriterionConfig
label_desc: Use image node_id 4 for calling the LatencyAugmentedLabelSmoothedCrossEntropyCriterion obj's underlying member method code with example usage: obj.reduce_metrics(cls, logging_outputs) without return types