code: def forward(
      self,
      source_encoded: pt.Tensor,
      source_length: pt.Tensor,
      att_mask: pt.Tensor,
  ):
      # TODO: att_mask might need to include prepended token masks
      if self.model_type == C.NVS_TYPE_LOGIT_MAX:
          # ============
          # logit max:
          # ============
          bow_pred = self.project_vocab(source_encoded)
          bow_pred = bow_pred.masked_fill(
              att_mask.unsqueeze(2), -pt.inf
          )
          bow_pred, _ = pt.max(bow_pred, dim=1)
      elif C.NVS_TYPE_EOS:
          # ============
          # EOS based:
          # ============
          batch_size, max_len, _ = source_encoded.size()
          source_encoded = source_encoded[
              pt.arange(0, batch_size, dtype=pt.long),
              (source_length[:, 0] - 1).long(),
          ]
          bow_pred = self.project_vocab(source_encoded)
      else:
          raise ValueError("Unknown neural vocabulary selection type.")
  
      return bow_pred
  
imports: from typing import Optional
  import torch
  from .None import constants
label_desc: Use image node_id 2 for calling the NeuralVocabSelection obj's underlying member method code with example usage: obj.forward(source_encoded, source_length, att_mask) and returns: bow_pred