code: def test_transition_scores_greedy_search(self):
      model_cls = self.framework_dependent_parameters[
          "AutoModelForCausalLM"
      ]
      return_tensors = self.framework_dependent_parameters[
          "return_tensors"
      ]
      is_pt = not model_cls.__name__.startswith("TF")
  
      articles = ["Justin Timberlake", "Michael Phelps"]
      tokenizer = AutoTokenizer.from_pretrained(
          "distilgpt2", padding_side="left"
      )
      tokenizer.pad_token = tokenizer.eos_token
  
      model = model_cls.from_pretrained("distilgpt2")
      input_ids = tokenizer(
          articles, return_tensors=return_tensors, padding=True
      ).input_ids
      if is_pt:
          model = model.to(torch_device)
          input_ids = input_ids.to(torch_device)
  
      outputs = model.generate(
          input_ids=input_ids,
          max_new_tokens=5,
          pad_token_id=tokenizer.eos_token_id,
          eos_token_id=None,
          return_dict_in_generate=True,
          output_scores=True,
      )
  
      transition_scores = model.compute_transition_scores(
          outputs.sequences, outputs.scores
      )
      if is_pt:
          transition_scores = transition_scores.cpu().numpy()
  
      expected_scores = np.array(
          [
              [-57.8844, -60.45698, -70.16364, -65.50791, -66.35648],
              [
                  -54.417572,
                  -60.216614,
                  -62.661243,
                  -58.621933,
                  -58.298683,
              ],
          ]
      )
      self.assertTrue(
          np.allclose(transition_scores, expected_scores, atol=1e-3)
      )
  
imports: import numpy
  from transformers import AutoTokenizer
  from transformers.testing_utils import slow, torch_device
label_desc: Use image node_id 6 for calling the GenerationIntegrationTestsMixin obj's underlying member method code with example usage: obj.test_transition_scores_greedy_search() without return types