class_docstr: Represents a sequence-to-sequence batch.
class_docstr_tok: ["Represents","a","sequence-to-sequence","batch","."]
docstr: Return the number of elements in the source sequences.
docstr_tok: ["Return","the","number","of","elements","in","the","source","sequences","."]
code: def num_source_elements(self) -> int:
      """Return the number of elements in the source sequences."""
      if self.source_padding_mask is None:
          return self.source_seqs.numel()
  
      return int(self.source_padding_mask.seq_lens.sum())
  
imports: from __future__ import annotations
  import math
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Any, Optional, Sequence, Tuple, final
  import torch
  from torch import Tensor
  from torch.nn import Module
  from torcheval.metrics import Mean, Sum, Throughput
  from fairseq2.data import VocabularyInfo
  from fairseq2.gang import Gang
  from fairseq2.metrics import MetricBag
  from fairseq2.models.sequence import SequenceModelOutput
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.typing import finaloverride
label_desc: Use image node_id 3 for calling the Seq2SeqBatch obj's underlying member method code with example usage: obj.num_source_elements() and returns: int, self