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)
          probs = softmax(logits, dim=-1, dtype=torch.float32)
  
          if probs.isnan().any():
              raise RuntimeError(
                  "The model has produced one or more NaN probabilities during prefill. The sequence generator cannot continue."
              )
  
          if self.step_scores is not None:
              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(
                  probs, dim=-1, index=self.seqs[:, s].unsqueeze(-1)
              )
  
              # Bootstrap the step scores.
              # (P, S_prm - 1)
              self.step_scores[:, s] = prompt_scores.squeeze(-1)
  
          chunk_begin += chunk_size
  
      if self.step_hooks:
          seqs = self.seqs[:, :prefill_len]
  
          if self.step_scores is None:
              step_scores = None
          else:
              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 typing import Dict, List, Optional, Sequence, Tuple, Union, final
  import torch
  from torch import Tensor
  from torch.nn.functional import 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.ops import repeat_interleave
  from fairseq2.nn.padding import PaddingMask
  from fairseq2.typing import finaloverride, override
label_desc: Use image node_id 4 for calling the _SamplingSequenceGeneratorOpBase obj's underlying member method code with example usage: obj._prefill() without return types