code: def test_no_repeat_ngram_dist_processor(self):
      vocab_size = 3
      batch_size = 2
  
      input_ids = torch.tensor(
          [[1, 1, 2, 1], [0, 1, 0, 1]],
          device=torch_device,
          dtype=torch.long,
      )
      scores = self._get_uniform_logits(batch_size, vocab_size)
  
      no_repeat_proc_2_gram = NoRepeatNGramLogitsProcessor(2)
      no_repeat_proc_3_gram = NoRepeatNGramLogitsProcessor(3)
  
      filtered_scores_2_gram = no_repeat_proc_2_gram(
          input_ids, scores.clone()
      )
      filtered_scores_3_gram = no_repeat_proc_3_gram(
          input_ids, scores.clone()
      )
  
      # 2-gram would forbid 2nd and 3rd token (1,2) at 1st batch and 1st token (0) at 2nd batch
      self.assertListEqual(
          torch.isinf(filtered_scores_2_gram).tolist(),
          [[False, True, True], [True, False, False]],
      )
  
      # 3-gram would forbid no token at 1st batch and 1st token (0) at 2nd batch
      self.assertListEqual(
          torch.isinf(filtered_scores_3_gram).tolist(),
          [[False, False, False], [True, False, False]],
      )
  
imports: import unittest
  from typing import List, Union
  from parameterized import parameterized
  from transformers import is_torch_available
  from transformers.testing_utils import require_torch, torch_device
  from ..test_modeling_common import ids_tensor
label_desc: Use image node_id 12 for calling the LogitsProcessorTest obj's underlying member method code with example usage: obj.test_no_repeat_ngram_dist_processor() without return types