code: def _prefill(self) -> None:
      chunk_begin = 0
  
      prefill_len = self.min_prompt_len
  
      while chunk_begin < prefill_len - 1:
          chunk_size = prefill_len - chunk_begin - 1
  
          # Decode by chunks of `prefill_chunk_size`.
          if (
              self.prefill_chunk_size
              and chunk_size > self.prefill_chunk_size
          ):
              chunk_size = self.prefill_chunk_size
  
          chunk_end = chunk_begin + chunk_size
  
          model_output = self._decode(
              self.seqs[:, chunk_begin:chunk_end]
          )
  
          self.state_bag.increment_step_nr(chunk_size)
  
          logits = model_output.logits
  
          if self.temperature != 1.0:
              logits /= self.temperature
  
          # (P, S_prm - 1, V)
          lprobs = log_softmax(logits, dim=-1, dtype=torch.float32)
  
          if lprobs.isnan().any():
              raise RuntimeError(
                  "The model has produced one or more NaN probabilities during prefill. The sequence generator cannot continue."
              )
  
          s = slice(chunk_begin + 1, chunk_end + 1)
  
          # Fetch the scores of the next prompt step.
          # (P, S_prm - 1, 1)
          prompt_scores = torch.gather(
              lprobs, dim=-1, index=self.seqs[:, s].unsqueeze(-1)
          )
  
          # (P, S_prm - 1, 1) -> (P, S_prm - 1)
          prompt_scores.squeeze_(-1).cumsum_(dim=-1)
  
          prompt_scores += self.step_scores[:, chunk_begin].unsqueeze(
              -1
          )
  
          # Bootstrap the step scores.
          # (P x B, S_prm - 1)
          self.step_scores[:, s] = prompt_scores
  
          chunk_begin += chunk_size
  
      if self.step_hooks:
          seqs = self.seqs[:, :prefill_len]
  
          step_scores = self.step_scores[:, :prefill_len]
  
          for hook in self.step_hooks.values():
              hook(self.prompt_indices, seqs, step_scores, prefill=True)
  
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 4 for calling the _BeamSearchSequenceGeneratorOpBase obj's underlying member method code with example usage: obj._prefill() without return types