class_docstr: [`LogitsWarper`] that performs top-k, i.e. restricting to the k highest probability elements.
  This version allows for a separate value for each sample and runs inplace when possible.
  It doesn't validate inputs.
  
  Args:
      top_k (`int`):
          The number of highest probability vocabulary tokens to keep for top-k-filtering.
      filter_value (`float`, *optional*, defaults to `-float("Inf")`):
          All filtered values will be set to this float value.
      min_tokens_to_keep (`int`, *optional*, defaults to 1):
          Minimum number of tokens that cannot be filtered.
code: def filter(self, indices):
      self.top_k = [self.top_k[i] for i in indices]
      disabled = [x == 0 for x in self.top_k]
  
      if not all(disabled):
          self.top_k_tensor = self.top_k_tensor[indices]
          self.max_top_k = max(self.top_k)
  
          if self.top_k_disabled_mask is not None:
              self.top_k_disabled_mask = (
                  self.top_k_disabled_mask[indices]
                  if any(disabled)
                  else None
              )
  
          return self
      return None
  
imports: import math
  import torch
  from functools import lru_cache
  from typing import Optional, List, Dict, Union
  from transformers import LogitsWarper, LogitsProcessor, TemperatureLogitsWarper, TopKLogitsWarper, TopPLogitsWarper, TypicalLogitsWarper
label_desc: Use image node_id 3 for calling the HeterogeneousTopKLogitsWarper obj's underlying member method code with example usage: obj.filter(indices) and returns: None, self