code: def test_forced_bos_token_logits_processor(self):
      vocab_size = 20
      batch_size = 4
      bos_token_id = 0
  
      logits_processor = ForcedBOSTokenLogitsProcessor(
          bos_token_id=bos_token_id
      )
  
      # check that all scores are -inf except the bos_token_id score
      input_ids = ids_tensor((batch_size, 1), vocab_size=20)
      scores = self._get_uniform_logits(batch_size, vocab_size)
      scores = logits_processor(input_ids, scores)
      self.assertTrue(
          torch.isneginf(scores[:, bos_token_id + 1 :]).all()
      )
      self.assertListEqual(
          scores[:, bos_token_id].tolist(), 4 * [0]
      )  # score for bos_token_id shold be zero
  
      # check that bos_token_id is not forced if current length is greater than 1
      input_ids = ids_tensor((batch_size, 4), vocab_size=20)
      scores = self._get_uniform_logits(batch_size, vocab_size)
      scores = logits_processor(input_ids, scores)
      self.assertFalse(torch.isinf(scores).any())
  
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 19 for calling the LogitsProcessorTest obj's underlying member method code with example usage: obj.test_forced_bos_token_logits_processor() without return types