class_docstr: Implementation for the loss used in masked language model (MLM) training.
  This optionally also computes the next sentence prediction (NSP) loss and
  adds it to the overall loss based on the specified args. There are three
  cases to consider:
      1) Generic MLM training without NSP loss. In this case sentence_targets
         and sentence_logits are both None.
      2) BERT training without NSP loss. In this case sentence_targets is
         not None but sentence_logits is None and we should not be computing
         a sentence level loss.
      3) BERT training with NSP loss. In this case both sentence_targets and
         sentence_logits are not None and we should be computing a sentence
         level loss. The weight of the sentence level loss is specified as
         an argument.
docstr: Whether the logging outputs returned by `forward` can be summed
  across workers prior to calling `reduce_metrics`. Setting this
  to True will improves distributed training speed.
docstr_tok: ["Whether","the","logging","outputs","returned","by","`","forward","`","can","be","summed","across","workers","prior","to","calling","`","reduce_metrics","`",".","Setting","this","to","True","will","improves","distributed","training","speed","."]
code: def logging_outputs_can_be_summed() -> bool:
      """
      Whether the logging outputs returned by `forward` can be summed
      across workers prior to calling `reduce_metrics`. Setting this
      to True will improves distributed training speed.
      """
      return True
  
file_path: fairseq/fairseq/criterions/legacy_masked_lm.py
imports: import math
  import torch
  import torch.nn.functional
  from fairseq import utils
  from fairseq.logging import metrics
  from fairseq.criterions import FairseqCriterion, register_criterion
label_desc: Use image node_id 5 for calling the LegacyMaskedLmLoss obj's underlying member method code with example usage: obj.logging_outputs_can_be_summed() and returns: True