
"""simple docstring"""

import tempfile
import unittest

import numpy as np

import transformers
from transformers import GPTaTokenizer, GPTJConfig, is_flax_available, is_torch_available
from transformers.testing_utils import is_pt_flax_cross_test, require_flax, tooslow

from ...generation.test_flax_utils import FlaxGenerationTesterMixin
from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
   import jax
   import jax.numpy as jnp

   from transformers.modeling_flax_pytorch_utils import (
       convert_pytorch_state_dict_to_flax,
       load_flax_weights_in_pytorch_model,
   )
   from transformers.models.gptj.modeling_flax_gptj import FlaxGPTJForCausalLM, FlaxGPTJModel

if is_torch_available():
   import torch
class      _UpperCAmelCase							:




      def __init__(							self   ,       lowercase_   ,       lowercase_=1_4   ,       lowercase_=7   ,       lowercase_=True   ,       lowercase_=True   ,       lowercase_=False   ,       lowercase_=True   ,       lowercase_=9_9   ,       lowercase_=3_2   ,       lowercase_=4   ,       lowercase_=4   ,       lowercase_=4   ,       lowercase_=3_7   ,       lowercase_="gelu"   ,       lowercase_=0.1   ,       lowercase_=0.1   ,       lowercase_=5_1_2   ,       lowercase_=0.0_2   ,       )						->					Tuple:
          UpperCAmelCase									=					parent
          UpperCAmelCase									=					batch_size
          UpperCAmelCase									=					seq_length
          UpperCAmelCase									=					is_training
          UpperCAmelCase									=					use_input_mask
          UpperCAmelCase									=					use_token_type_ids
          UpperCAmelCase									=					use_labels
          UpperCAmelCase									=					vocab_size
          UpperCAmelCase									=					hidden_size
          UpperCAmelCase									=					rotary_dim
          UpperCAmelCase									=					num_hidden_layers
          UpperCAmelCase									=					num_attention_heads
          UpperCAmelCase									=					intermediate_size
          UpperCAmelCase									=					hidden_act
          UpperCAmelCase									=					hidden_dropout_prob
          UpperCAmelCase									=					attention_probs_dropout_prob
          UpperCAmelCase									=					max_position_embeddings
          UpperCAmelCase									=					initializer_range
          UpperCAmelCase									=					None
          UpperCAmelCase									=					vocab_size - 1
          UpperCAmelCase									=					vocab_size - 1
          UpperCAmelCase									=					vocab_size - 1




      def     a_      (							self							)						->					Union[str, Any]:
          UpperCAmelCase									=					ids_tensor([self.batch_size, self.seq_length]   ,       self.vocab_size							)

          UpperCAmelCase									=					None
          if self.use_input_mask:
              UpperCAmelCase									=					random_attention_mask([self.batch_size, self.seq_length]							)

          UpperCAmelCase									=					GPTJConfig(
              vocab_size=self.vocab_size   ,       n_embd=self.hidden_size   ,       n_layer=self.num_hidden_layers   ,       n_head=self.num_attention_heads   ,       n_positions=self.max_position_embeddings   ,       use_cache=_lowercase   ,       bos_token_id=self.bos_token_id   ,       eos_token_id=self.eos_token_id   ,       pad_token_id=self.pad_token_id   ,       rotary_dim=self.rotary_dim   ,       )

          return (config, input_ids, input_mask)




      def     a_      (							self							)						->					Any:
          UpperCAmelCase									=					self.prepare_config_and_inputs()
          UpperCAmelCase			,							UpperCAmelCase			,							UpperCAmelCase									=					config_and_inputs
          UpperCAmelCase									=					{'input_ids': input_ids, 'attention_mask': attention_mask}
          return config, inputs_dict




      def     a_      (							self   ,       lowercase_   ,       lowercase_   ,       lowercase_   ,       lowercase_							)						->					List[str]:
          UpperCAmelCase									=					2_0
          UpperCAmelCase									=					model_class_name(_lowercase							)

          UpperCAmelCase									=					model.init_cache(input_ids.shape[0]   ,       _lowercase							)
          UpperCAmelCase									=					jnp.ones((input_ids.shape[0], max_decoder_length)   ,       dtype='i4'							)

          UpperCAmelCase									=					jnp.broadcast_to(
              jnp.arange(input_ids.shape[-1] - 1							)[None, :]   ,       (input_ids.shape[0], input_ids.shape[-1] - 1)							)
          UpperCAmelCase									=					model(
              input_ids[:, :-1]   ,       attention_mask=_lowercase   ,       past_key_values=_lowercase   ,       position_ids=_lowercase   ,       )

          UpperCAmelCase									=					jnp.array(input_ids.shape[0] * [[input_ids.shape[-1] - 1]]   ,       dtype='i4'							)
          UpperCAmelCase									=					model(
              input_ids[:, -1:]   ,       attention_mask=_lowercase   ,       past_key_values=outputs_cache.past_key_values   ,       position_ids=_lowercase   ,       )

          UpperCAmelCase									=					model(_lowercase							)

          UpperCAmelCase									=					np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])							)							)
          self.parent.assertTrue(diff < 1E-3   ,       msg=F"Max diff is {diff}"							)




      def     a_      (							self   ,       lowercase_   ,       lowercase_   ,       lowercase_   ,       lowercase_							)						->					Optional[int]:
          UpperCAmelCase									=					2_0
          UpperCAmelCase									=					model_class_name(_lowercase							)

          UpperCAmelCase									=					jnp.concatenate(
              [attention_mask, jnp.zeros((attention_mask.shape[0], max_decoder_length - attention_mask.shape[1])							)]   ,       axis=-1   ,       )

          UpperCAmelCase									=					model.init_cache(input_ids.shape[0]   ,       _lowercase							)
          UpperCAmelCase									=					jnp.broadcast_to(
              jnp.arange(input_ids.shape[-1] - 1							)[None, :]   ,       (input_ids.shape[0], input_ids.shape[-1] - 1)							)

          UpperCAmelCase									=					model(
              input_ids[:, :-1]   ,       attention_mask=_lowercase   ,       past_key_values=_lowercase   ,       position_ids=_lowercase   ,       )
          UpperCAmelCase									=					jnp.array(input_ids.shape[0] * [[input_ids.shape[-1] - 1]]   ,       dtype='i4'							)
          UpperCAmelCase									=					model(
              input_ids[:, -1:]   ,       past_key_values=outputs_cache.past_key_values   ,       attention_mask=_lowercase   ,       position_ids=_lowercase   ,       )

          UpperCAmelCase									=					model(_lowercase   ,       attention_mask=_lowercase							)

          UpperCAmelCase									=					np.max(np.abs((outputs_cache_next[0][:, -1, :5] - outputs[0][:, -1, :5])							)							)
          self.parent.assertTrue(diff < 1E-3   ,       msg=F"Max diff is {diff}"							)

@require_flax
class      _UpperCAmelCase							(		UpperCAmelCase_     ,			UpperCAmelCase_     ,			unittest.TestCase							):
      __SCREAMING_SNAKE_CASE   :							Optional[Any]							      =	(FlaxGPTJModel, FlaxGPTJForCausalLM) if is_flax_available() else ()
      __SCREAMING_SNAKE_CASE   :							List[str]							      =	(FlaxGPTJForCausalLM,) if is_flax_available() else ()




      def     a_      (							self							)						->					List[str]:
          UpperCAmelCase									=					FlaxGPTJModelTester(self							)




      def     a_      (							self							)						->					Tuple:
          for model_class_name in self.all_model_classes:
              UpperCAmelCase			,							UpperCAmelCase			,							UpperCAmelCase									=					self.model_tester.prepare_config_and_inputs()
              self.model_tester.check_use_cache_forward(_lowercase   ,       _lowercase   ,       _lowercase   ,       _lowercase							)




      def     a_      (							self							)						->					int:
          for model_class_name in self.all_model_classes:
              UpperCAmelCase			,							UpperCAmelCase			,							UpperCAmelCase									=					self.model_tester.prepare_config_and_inputs()
              self.model_tester.check_use_cache_forward_with_attn_mask(
                  _lowercase   ,       _lowercase   ,       _lowercase   ,       _lowercase							)




      @tooslow
      def     a_      (							self							)						->					Tuple:
          UpperCAmelCase									=					GPTaTokenizer.from_pretrained('gpt2'   ,       pad_token='<|endoftext|>'   ,       padding_side='left'							)
          UpperCAmelCase									=					tokenizer(['Hello this is a long string', 'Hey']   ,       return_tensors='np'   ,       padding=_lowercase   ,       truncation=_lowercase							)

          UpperCAmelCase									=					FlaxGPTJForCausalLM.from_pretrained('EleutherAI/gpt-j-6B'							)
          UpperCAmelCase									=					False
          UpperCAmelCase									=					model.config.eos_token_id

          UpperCAmelCase									=					jax.jit(model.generate							)

          UpperCAmelCase									=					jit_generate(
              inputs['input_ids']   ,       attention_mask=inputs['attention_mask']   ,       pad_token_id=tokenizer.pad_token_id							).sequences

          UpperCAmelCase									=					tokenizer.batch_decode(_lowercase   ,       skip_special_tokens=_lowercase							)

          UpperCAmelCase									=					[
              'Hello this is a long string of text.\n\nI\'m trying to get the text of the',
              'Hey, I\'m a little late to the party. I\'m going to',
          ]

          self.assertListEqual(_lowercase   ,       _lowercase							)




      @is_pt_flax_cross_test
      def     a_      (							self							)						->					Any:
          UpperCAmelCase			,							UpperCAmelCase									=					self.model_tester.prepare_config_and_inputs_for_common()

          for model_class in self.all_model_classes:
              with self.subTest(model_class.__name__							):
                  # prepare inputs
                  UpperCAmelCase									=					self._prepare_for_class(_lowercase   ,       _lowercase							)
                  UpperCAmelCase									=					{k: torch.tensor(v.tolist()							) for k, v in prepared_inputs_dict.items()}

                  # load corresponding PyTorch class
                  UpperCAmelCase									=					model_class.__name__[4:]  # Skip the "Flax" at the beginning
                  UpperCAmelCase									=					getattr(_lowercase   ,       _lowercase							)

                  UpperCAmelCase			,							UpperCAmelCase									=					pt_inputs['input_ids'].shape
                  UpperCAmelCase									=					np.random.randint(0   ,       seq_length - 1   ,       size=(batch_size,)							)
                  for batch_idx, start_index in enumerate(_lowercase							):
                      UpperCAmelCase									=					0
                      UpperCAmelCase									=					1
                      UpperCAmelCase									=					0
                      UpperCAmelCase									=					1
                  UpperCAmelCase									=					pt_model_class(_lowercase							).eval()
                  UpperCAmelCase									=					model_class(_lowercase   ,       dtype=jnp.floataa							)

                  UpperCAmelCase									=					convert_pytorch_state_dict_to_flax(pt_model.state_dict()   ,       _lowercase							)
                  UpperCAmelCase									=					fx_state

                  with torch.no_grad():
                      UpperCAmelCase									=					pt_model(**_lowercase							).to_tuple()

                  UpperCAmelCase									=					fx_model(**_lowercase							).to_tuple()
                  self.assertEqual(len(_lowercase							)   ,       len(_lowercase							)   ,       'Output lengths differ between Flax and PyTorch'							)
                  for fx_output, pt_output in zip(_lowercase   ,       _lowercase							):
                      self.assert_almost_equals(fx_output[:, -1]   ,       pt_output[:, -1].numpy()   ,       4E-2							)

                  with tempfile.TemporaryDirectory() as tmpdirname:
                      pt_model.save_pretrained(_lowercase							)
                      UpperCAmelCase									=					model_class.from_pretrained(_lowercase   ,       from_pt=_lowercase							)

                  UpperCAmelCase									=					fx_model_loaded(**_lowercase							).to_tuple()
                  self.assertEqual(
                      len(_lowercase							)   ,       len(_lowercase							)   ,       'Output lengths differ between Flax and PyTorch'							)
                  for fx_output_loaded, pt_output in zip(_lowercase   ,       _lowercase							):
                      self.assert_almost_equals(fx_output_loaded[:, -1]   ,       pt_output[:, -1].numpy()   ,       4E-2							)




      @is_pt_flax_cross_test
      def     a_      (							self							)						->					Any:
          UpperCAmelCase			,							UpperCAmelCase									=					self.model_tester.prepare_config_and_inputs_for_common()
          for model_class in self.all_model_classes:
              with self.subTest(model_class.__name__							):
                  # prepare inputs
                  UpperCAmelCase									=					self._prepare_for_class(_lowercase   ,       _lowercase							)
                  UpperCAmelCase									=					{k: torch.tensor(v.tolist()							) for k, v in prepared_inputs_dict.items()}

                  # load corresponding PyTorch class
                  UpperCAmelCase									=					model_class.__name__[4:]  # Skip the "Flax" at the beginning
                  UpperCAmelCase									=					getattr(_lowercase   ,       _lowercase							)

                  UpperCAmelCase									=					pt_model_class(_lowercase							).eval()
                  UpperCAmelCase									=					model_class(_lowercase   ,       dtype=jnp.floataa							)

                  UpperCAmelCase									=					load_flax_weights_in_pytorch_model(_lowercase   ,       fx_model.params							)
                  UpperCAmelCase			,							UpperCAmelCase									=					pt_inputs['input_ids'].shape
                  UpperCAmelCase									=					np.random.randint(0   ,       seq_length - 1   ,       size=(batch_size,)							)
                  for batch_idx, start_index in enumerate(_lowercase							):
                      UpperCAmelCase									=					0
                      UpperCAmelCase									=					1
                      UpperCAmelCase									=					0
                      UpperCAmelCase									=					1

                  # make sure weights are tied in PyTorch
                  pt_model.tie_weights()

                  with torch.no_grad():
                      UpperCAmelCase									=					pt_model(**_lowercase							).to_tuple()

                  UpperCAmelCase									=					fx_model(**_lowercase							).to_tuple()
                  self.assertEqual(len(_lowercase							)   ,       len(_lowercase							)   ,       'Output lengths differ between Flax and PyTorch'							)
                  for fx_output, pt_output in zip(_lowercase   ,       _lowercase							):
                      self.assert_almost_equals(fx_output[:, -1]   ,       pt_output[:, -1].numpy()   ,       4E-2							)

                  with tempfile.TemporaryDirectory() as tmpdirname:
                      fx_model.save_pretrained(_lowercase							)
                      UpperCAmelCase									=					pt_model_class.from_pretrained(_lowercase   ,       from_flax=_lowercase							)

                  with torch.no_grad():
                      UpperCAmelCase									=					pt_model_loaded(**_lowercase							).to_tuple()

                  self.assertEqual(
                      len(_lowercase							)   ,       len(_lowercase							)   ,       'Output lengths differ between Flax and PyTorch'							)
                  for fx_output, pt_output in zip(_lowercase   ,       _lowercase							):
                      self.assert_almost_equals(fx_output[:, -1]   ,       pt_output[:, -1].numpy()   ,       4E-2							)




      @tooslow
      def     a_      (							self							)						->					Optional[Any]:
          for model_class_name in self.all_model_classes:
              UpperCAmelCase									=					model_class_name.from_pretrained('EleutherAI/gpt-j-6B'							)
              UpperCAmelCase									=					model(np.ones((1, 1)							)							)
              self.assertIsNotNone(_lowercase							)





"""simple docstring"""

import itertools
import os
import random
import tempfile
import unittest

import numpy as np

from transformers import TvltFeatureExtractor, is_datasets_available
from transformers.testing_utils import check_json_file_has_correct_format, require_torch, require_torchaudio
from transformers.utils.import_utils import is_torch_available

from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin


if is_torch_available():
   import torch

if is_datasets_available():
   from datasets import load_dataset

SCREAMING_SNAKE_CASE_    					=						random.Random()




def     lowercase__						(					lowerCAmelCase				:					Any ,				lowerCAmelCase				:					Tuple=1.0 ,				lowerCAmelCase				:					Tuple=None ,				lowerCAmelCase				:					List[str]=None ) ->      Dict:






    """simple docstring"""




    if rng is None:
        UpperCAmelCase									=					global_rng

    UpperCAmelCase									=					[]
    for batch_idx in range(shape[0] ):
        values.append([] )
        for _ in range(shape[1] ):
            values[-1].append(rng.random() * scale )

    return values
class      _UpperCAmelCase							(		unittest.TestCase							):




      def __init__(							self   ,       lowercase_   ,       lowercase_=7   ,       lowercase_=4_0_0   ,       lowercase_=2_0_0_0   ,       lowercase_=2_0_4_8   ,       lowercase_=1_2_8   ,       lowercase_=1   ,       lowercase_=5_1_2   ,       lowercase_=3_0   ,       lowercase_=4_4_1_0_0   ,       )						->					str:
          UpperCAmelCase									=					parent
          UpperCAmelCase									=					batch_size
          UpperCAmelCase									=					min_seq_length
          UpperCAmelCase									=					max_seq_length
          UpperCAmelCase									=					(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
          UpperCAmelCase									=					spectrogram_length
          UpperCAmelCase									=					feature_size
          UpperCAmelCase									=					num_audio_channels
          UpperCAmelCase									=					hop_length
          UpperCAmelCase									=					chunk_length
          UpperCAmelCase									=					sampling_rate




      def     a_      (							self							)						->					str:
          return {
              "spectrogram_length": self.spectrogram_length,
              "feature_size": self.feature_size,
              "num_audio_channels": self.num_audio_channels,
              "hop_length": self.hop_length,
              "chunk_length": self.chunk_length,
              "sampling_rate": self.sampling_rate,
          }




      def     a_      (							self   ,       lowercase_=False   ,       lowercase_=False							)						->					Optional[Any]:
          def _flatten(lowercase_							):
              return list(itertools.chain(*lowercase_							)							)

          if equal_length:
              UpperCAmelCase									=					[floats_list((self.max_seq_length, self.feature_size)							) for _ in range(self.batch_size							)]
          else:
              # make sure that inputs increase in size
              UpperCAmelCase									=					[
                  floats_list((x, self.feature_size)							)
                  for x in range(self.min_seq_length   ,       self.max_seq_length   ,       self.seq_length_diff							)
              ]
          if numpify:
              UpperCAmelCase									=					[np.asarray(lowercase_							) for x in speech_inputs]
          return speech_inputs

@require_torch
@require_torchaudio
class      _UpperCAmelCase							(		SCREAMING_SNAKE_CASE_     ,			unittest.TestCase							):
      __SCREAMING_SNAKE_CASE   :							List[str]							      =	TvltFeatureExtractor




      def     a_      (							self							)						->					Optional[int]:
          UpperCAmelCase									=					TvltFeatureExtractionTester(self							)




      def     a_      (							self							)						->					Optional[Any]:
          UpperCAmelCase									=					self.feature_extraction_class(**self.feat_extract_dict							)
          self.assertTrue(hasattr(lowercase_   ,       'spectrogram_length'							)							)
          self.assertTrue(hasattr(lowercase_   ,       'feature_size'							)							)
          self.assertTrue(hasattr(lowercase_   ,       'num_audio_channels'							)							)
          self.assertTrue(hasattr(lowercase_   ,       'hop_length'							)							)
          self.assertTrue(hasattr(lowercase_   ,       'chunk_length'							)							)
          self.assertTrue(hasattr(lowercase_   ,       'sampling_rate'							)							)




      def     a_      (							self							)						->					List[Any]:
          UpperCAmelCase									=					self.feature_extraction_class(**self.feat_extract_dict							)

          with tempfile.TemporaryDirectory() as tmpdirname:
              UpperCAmelCase									=					feat_extract_first.save_pretrained(lowercase_							)[0]
              check_json_file_has_correct_format(lowercase_							)
              UpperCAmelCase									=					self.feature_extraction_class.from_pretrained(lowercase_							)

          UpperCAmelCase									=					feat_extract_first.to_dict()
          UpperCAmelCase									=					feat_extract_second.to_dict()
          UpperCAmelCase									=					dict_first.pop('mel_filters'							)
          UpperCAmelCase									=					dict_second.pop('mel_filters'							)
          self.assertTrue(np.allclose(lowercase_   ,       lowercase_							)							)
          self.assertEqual(lowercase_   ,       lowercase_							)




      def     a_      (							self							)						->					str:
          UpperCAmelCase									=					self.feature_extraction_class(**self.feat_extract_dict							)

          with tempfile.TemporaryDirectory() as tmpdirname:
              UpperCAmelCase									=					os.path.join(lowercase_   ,       'feat_extract.json'							)
              feat_extract_first.to_json_file(lowercase_							)
              UpperCAmelCase									=					self.feature_extraction_class.from_json_file(lowercase_							)

          UpperCAmelCase									=					feat_extract_first.to_dict()
          UpperCAmelCase									=					feat_extract_second.to_dict()
          UpperCAmelCase									=					dict_first.pop('mel_filters'							)
          UpperCAmelCase									=					dict_second.pop('mel_filters'							)
          self.assertTrue(np.allclose(lowercase_   ,       lowercase_							)							)
          self.assertEqual(lowercase_   ,       lowercase_							)




      def     a_      (							self							)						->					int:
          # Initialize feature_extractor
          UpperCAmelCase									=					self.feature_extraction_class(**self.feat_extract_dict							)

          # create three inputs of length 800, 1000, and 1200
          UpperCAmelCase									=					[floats_list((1, x)							)[0] for x in range(8_0_0   ,       1_4_0_0   ,       2_0_0							)]
          UpperCAmelCase									=					[np.asarray(lowercase_							) for speech_input in speech_inputs]

          # Test not batched input
          UpperCAmelCase									=					feature_extractor(np_speech_inputs[0]   ,       return_tensors='np'   ,       sampling_rate=4_4_1_0_0							).audio_values

          self.assertTrue(encoded_audios.ndim == 4							)
          self.assertTrue(encoded_audios.shape[-1] == feature_extractor.feature_size							)
          self.assertTrue(encoded_audios.shape[-2] <= feature_extractor.spectrogram_length							)
          self.assertTrue(encoded_audios.shape[-3] == feature_extractor.num_channels							)

          # Test batched
          UpperCAmelCase									=					feature_extractor(lowercase_   ,       return_tensors='np'   ,       sampling_rate=4_4_1_0_0							).audio_values

          self.assertTrue(encoded_audios.ndim == 4							)
          self.assertTrue(encoded_audios.shape[-1] == feature_extractor.feature_size							)
          self.assertTrue(encoded_audios.shape[-2] <= feature_extractor.spectrogram_length							)
          self.assertTrue(encoded_audios.shape[-3] == feature_extractor.num_channels							)

          # Test audio masking
          UpperCAmelCase									=					feature_extractor(
              lowercase_   ,       return_tensors='np'   ,       sampling_rate=4_4_1_0_0   ,       mask_audio=lowercase_							).audio_values

          self.assertTrue(encoded_audios.ndim == 4							)
          self.assertTrue(encoded_audios.shape[-1] == feature_extractor.feature_size							)
          self.assertTrue(encoded_audios.shape[-2] <= feature_extractor.spectrogram_length							)
          self.assertTrue(encoded_audios.shape[-3] == feature_extractor.num_channels							)

          # Test 2-D numpy arrays are batched.
          UpperCAmelCase									=					[floats_list((1, x)							)[0] for x in (8_0_0, 8_0_0, 8_0_0)]
          UpperCAmelCase									=					np.asarray(lowercase_							)
          UpperCAmelCase									=					feature_extractor(lowercase_   ,       return_tensors='np'   ,       sampling_rate=4_4_1_0_0							).audio_values
          self.assertTrue(encoded_audios.ndim == 4							)
          self.assertTrue(encoded_audios.shape[-1] == feature_extractor.feature_size							)
          self.assertTrue(encoded_audios.shape[-2] <= feature_extractor.spectrogram_length							)
          self.assertTrue(encoded_audios.shape[-3] == feature_extractor.num_channels							)




      def     a_      (							self   ,       lowercase_							)						->					Optional[Any]:
          UpperCAmelCase									=					load_dataset('hf-internal-testing/librispeech_asr_dummy'   ,       'clean'   ,       split='validation'							)
          # automatic decoding with librispeech
          UpperCAmelCase									=					ds.sort('id'							).select(range(lowercase_							)							)[:num_samples]['audio']

          return [x["array"] for x in speech_samples]




      def     a_      (							self							)						->					Tuple:
          UpperCAmelCase									=					self._load_datasamples(1							)
          UpperCAmelCase									=					TvltFeatureExtractor()
          UpperCAmelCase									=					feature_extractor(lowercase_   ,       return_tensors='pt'							).audio_values

          self.assertEquals(audio_values.shape   ,       (1, 1, 1_9_2, 1_2_8)							)

          UpperCAmelCase									=					torch.tensor([[-0.3_0_3_2, -0.2_7_0_8], [-0.4_4_3_4, -0.4_0_0_7]]							)
          self.assertTrue(torch.allclose(audio_values[0, 0, :2, :2]   ,       lowercase_   ,       atol=1E-4							)							)



