class_docstr: Represents a hook to pass to :meth:`~SequenceGenerator.register_step_hook`
  or :meth:`~Seq2SeqGenerator.register_step_hook`.
class_docstr_tok: ["Represents","a","hook","to","pass","to",":","meth",":","`","~SequenceGenerator.register_step_hook","`","or",":","meth",":","`","~Seq2SeqGenerator.register_step_hook","`","."]
docstr: :param prompt_indices:
      The indices of the input prompts corresponding to each sequence in
      ``seqs``. *Shape:* :math:`(N)`, where :math:`N` is the batch size.
  :param seqs:
      The sequences that are in process of being generated. *Shape:*
      :math:`(N,S)`, where :math:`N` is the batch size and :math:`S` is
      the sequence length generated so far.
  :param step_scores:
      The score of each step in ``seqs``. *Shape:* Same as ``seqs``.
  :param prefill:
      If ``True``, the hook is called as part of prompt prefill.
docstr_tok: [":","param","prompt_indices",":","The","indices","of","the","input","prompts","corresponding","to","each","sequence","in","``","seqs","``",".","*","Shape",":","*",":","math",":","`","(","N",")","`",",","where",":","math",":","`","N","`","is","the","batch","size",".",":","param","seqs",":","The","sequences","that","are","in","process","of","being","generated",".","*","Shape",":","*",":","math",":","`","(","N",",","S",")","`",",","where",":","math",":","`","N","`","is","the","batch","size","and",":","math",":","`","S","`","is","the","sequence","length","generated","so","far",".",":","param","step_scores",":","The","score","of","each","step","in","``","seqs","``",".","*","Shape",":","*","Same","as","``","seqs","``",".",":","param","prefill",":","If","``","True","``",",","the","hook","is","called","as","part","of","prompt","prefill","."]
code: def __call__(
      self,
      prompt_indices: Tensor,
      seqs: Tensor,
      step_scores: Optional[Tensor],
      prefill: bool,
  ) -> None:
      """
      :param prompt_indices:
          The indices of the input prompts corresponding to each sequence in
          ``seqs``. *Shape:* :math:`(N)`, where :math:`N` is the batch size.
      :param seqs:
          The sequences that are in process of being generated. *Shape:*
          :math:`(N,S)`, where :math:`N` is the batch size and :math:`S` is
          the sequence length generated so far.
      :param step_scores:
          The score of each step in ``seqs``. *Shape:* Same as ``seqs``.
      :param prefill:
          If ``True``, the hook is called as part of prompt prefill.
      """
  
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from dataclasses import dataclass
  from typing import Dict, List, Optional, Protocol
  from torch import Tensor
  from torch.utils.hooks import RemovableHandle
  from fairseq2.models.decoder import DecoderModel
  from fairseq2.models.encoder_decoder import EncoderDecoderModel
  from fairseq2.nn.padding import PaddingMask
label_desc: Use image node_id 1 for calling the StepHook obj's underlying member method code with example usage: obj.__call__(prompt_indices, seqs, step_scores, prefill) without return types