code: def test_generate_encoder_outputs_attention_mask(self):
      model_cls = self.framework_dependent_parameters[
          "AutoModelForSpeechSeq2Seq"
      ]
      floats_tensor = self.framework_dependent_parameters[
          "floats_tensor"
      ]
      create_tensor_fn = self.framework_dependent_parameters[
          "create_tensor_fn"
      ]
      is_pt = not model_cls.__name__.startswith("TF")
  
      input_features = floats_tensor((3, 80, 60))
      attention_mask = create_tensor_fn(np.ones(input_features.shape))
      model = model_cls.from_pretrained(
          "hf-internal-testing/tiny-random-WhisperForConditionalGeneration"
      )
      if is_pt:
          input_features = input_features.to(torch_device)
          attention_mask = attention_mask.to(torch_device)
          model = model.to(torch_device)
  
      encoder = model.get_encoder()
      encoder_outputs = encoder(input_features)
  
      output_sequences_no_mask = model.generate(
          encoder_outputs=encoder_outputs
      )
      output_sequences_with_mask = model.generate(
          encoder_outputs=encoder_outputs, attention_mask=attention_mask
      )
      if is_pt:
          output_sequences_no_mask = (
              output_sequences_no_mask.cpu().numpy()
          )
          output_sequences_with_mask = (
              output_sequences_with_mask.cpu().numpy()
          )
  
      self.assertTrue(
          np.array_equal(
              output_sequences_no_mask, output_sequences_with_mask
          )
      )
  
imports: import numpy
  from transformers import AutoTokenizer
  from transformers.testing_utils import slow, torch_device
label_desc: Use image node_id 20 for calling the GenerationIntegrationTestsMixin obj's underlying member method code with example usage: obj.test_generate_encoder_outputs_attention_mask() without return types