class_docstr: Represents the output of a beam search algorithm.
class_docstr_tok: ["Represents","the","output","of","a","beam","search","algorithm","."]
docstr: Reduce the beam to the sequences included in ``mask``.
code: def masked_select(self, mask: Tensor) -> BeamStep:
      """Reduce the beam to the sequences included in ``mask``."""
      seq_indices = self.seq_indices.masked_select(mask)
  
      vocab_indices = self.vocab_indices.masked_select(mask)
  
      scores = self.scores.masked_select(mask)
  
      return BeamStep(seq_indices, vocab_indices, scores)
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Dict, List, Optional, Sequence, Tuple, Union, final
  import torch
  from torch import Tensor
  from torch.nn.functional import log_softmax
  from fairseq2.data import VocabularyInfo
  from fairseq2.generation.generator import Hypothesis, Seq2SeqGenerator, Seq2SeqGeneratorOutput, SequenceGenerator, SequenceGeneratorOutput, StepHook
  from fairseq2.generation.step_processor import StepProcessor
  from fairseq2.models.decoder import DecoderModel
  from fairseq2.models.encoder_decoder import EncoderDecoderModel
  from fairseq2.models.sequence import SequenceModelOutput
  from fairseq2.nn.incremental_state import IncrementalStateBag
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.typing import finaloverride, override
label_desc: Use image node_id 1 for calling the BeamStep obj's underlying member method code with example usage: obj.masked_select(mask) and returns: BeamStep