class_docstr: Helper class to record logits and force the given label token ids
class_docstr_tok: ["Helper","class","to","record","logits","and","force","the","given","label","token","ids"]
code: def __call__(self, input_ids, scores):
      idx = len(self.recorded_scores)
      # we pull the logits to CPU because they are not used as input,
      # therefore there is no device mismatch and we save a bit of GPU memory
      self.recorded_scores.append(scores[0].clone().cpu())
      mask = torch.ones(scores.size(), dtype=torch.bool)
      mask[0, self.label_ids[idx]] = False
      scores[mask] = -float("inf")
      return scores
  
imports: import importlib
  import warnings
  from string import Formatter
  import numpy
  import torch
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.utils import check_random_state
  from sklearn.utils.validation import check_is_fitted
  from transformers import AutoConfig, AutoTokenizer, LogitsProcessor
  from skorch.exceptions import LowProbabilityError
  from skorch.llm.prompts import DEFAULT_PROMPT_FEW_SHOT, DEFAULT_PROMPT_ZERO_SHOT, DELIM
label_desc: Use image node_id 2 for calling the _LogitsRecorder obj's underlying member method code with example usage: obj.__call__(input_ids, scores) and returns: scores