


import inspect
import unittest

from transformers import MobileNetVaConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
 import torch

 from transformers import MobileNetVaForImageClassification, MobileNetVaForSemanticSegmentation, MobileNetVaModel
 from transformers.models.mobilenet_va.modeling_mobilenet_va import MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from PIL import Image

 from transformers import MobileNetVaImageProcessor






class _lowerCamelCase(		_a  ):
       def      UpperCamelCase	(   self)			->  List[str]:




           """simple docstring"""

           _lowercase			:				Optional[int] 						=						self.config_class(**self.inputs_dict)
           self.parent.assertTrue(hasattr(lowerCamelCase, 'tf_padding'))
           self.parent.assertTrue(hasattr(lowerCamelCase, 'depth_multiplier'))






class _lowerCamelCase:
       def __init__(   self, lowerCamelCase, lowerCamelCase=13, lowerCamelCase=3, lowerCamelCase=32, lowerCamelCase=0.2_5, lowerCamelCase=8, lowerCamelCase=8, lowerCamelCase=6, lowerCamelCase=32, lowerCamelCase=True, lowerCamelCase=True, lowerCamelCase=True, lowerCamelCase="relu6", lowerCamelCase=12_80, lowerCamelCase=0.1, lowerCamelCase=0.0_2, lowerCamelCase=True, lowerCamelCase=True, lowerCamelCase=10, lowerCamelCase=None, )			->  Any:




           """simple docstring"""

           _lowercase			:				Union[str, Any] 						=						parent
           _lowercase			:				List[str] 						=						batch_size
           _lowercase			:				str 						=						num_channels
           _lowercase			:				List[str] 						=						image_size
           _lowercase			:				Optional[int] 						=						depth_multiplier
           _lowercase			:				str 						=						depth_divisible_by
           _lowercase			:				List[Any] 						=						min_depth
           _lowercase			:				str 						=						expand_ratio
           _lowercase			:				Any 						=						tf_padding
           _lowercase			:				int 						=						output_stride
           _lowercase			:				Optional[Any] 						=						first_layer_is_expansion
           _lowercase			:				str 						=						finegrained_output
           _lowercase			:				List[str] 						=						hidden_act
           _lowercase			:				List[Any] 						=						last_hidden_size if finegrained_output else int(last_hidden_size * depth_multiplier)
           _lowercase			:				Tuple 						=						classifier_dropout_prob
           _lowercase			:				Union[str, Any] 						=						use_labels
           _lowercase			:				int 						=						is_training
           _lowercase			:				List[Any] 						=						num_labels
           _lowercase			:				List[Any] 						=						initializer_range
           _lowercase			:				Any 						=						scope
       def      UpperCamelCase	(   self)			->  Optional[Any]:




           """simple docstring"""

           _lowercase			:				List[str] 						=						floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

           _lowercase			:				str 						=						None
           _lowercase			:				Tuple 						=						None
           if self.use_labels:
               _lowercase			:				Any 						=						ids_tensor([self.batch_size], self.num_labels)
               _lowercase			:				Optional[int] 						=						ids_tensor([self.batch_size, self.image_size, self.image_size], self.num_labels)

           _lowercase			:				Dict 						=						self.get_config()

           return config, pixel_values, labels, pixel_labels
       def      UpperCamelCase	(   self)			->  Union[str, Any]:




           """simple docstring"""

           return MobileNetVaConfig(
               num_channels=self.num_channels, image_size=self.image_size, depth_multiplier=self.depth_multiplier, depth_divisible_by=self.depth_divisible_by, min_depth=self.min_depth, expand_ratio=self.expand_ratio, output_stride=self.output_stride, first_layer_is_expansion=self.first_layer_is_expansion, finegrained_output=self.finegrained_output, hidden_act=self.hidden_act, tf_padding=self.tf_padding, classifier_dropout_prob=self.classifier_dropout_prob, initializer_range=self.initializer_range, )
       def      UpperCamelCase	(   self, lowerCamelCase, lowerCamelCase, lowerCamelCase, lowerCamelCase)			->  Tuple:




           """simple docstring"""

           _lowercase			:				int 						=						MobileNetVaModel(config=lowerCamelCase)
           model.to(lowerCamelCase)
           model.eval()
           _lowercase			:				Optional[int] 						=						model(lowerCamelCase)
           self.parent.assertEqual(
               result.last_hidden_state.shape, (
                   self.batch_size,
                   self.last_hidden_size,
                   self.image_size // self.output_stride,
                   self.image_size // self.output_stride,
               ), )
           self.parent.assertEqual(
               result.pooler_output.shape, (self.batch_size, self.last_hidden_size), )
       def      UpperCamelCase	(   self, lowerCamelCase, lowerCamelCase, lowerCamelCase, lowerCamelCase)			->  Tuple:




           """simple docstring"""

           _lowercase			:				Dict 						=						self.num_labels
           _lowercase			:				Dict 						=						MobileNetVaForImageClassification(lowerCamelCase)
           model.to(lowerCamelCase)
           model.eval()
           _lowercase			:				str 						=						model(lowerCamelCase, labels=lowerCamelCase)
           self.parent.assertEqual(result.logits.shape, (self.batch_size, self.num_labels))
       def      UpperCamelCase	(   self, lowerCamelCase, lowerCamelCase, lowerCamelCase, lowerCamelCase)			->  Any:




           """simple docstring"""

           _lowercase			:				str 						=						self.num_labels
           _lowercase			:				List[str] 						=						MobileNetVaForSemanticSegmentation(lowerCamelCase)
           model.to(lowerCamelCase)
           model.eval()
           _lowercase			:				Any 						=						model(lowerCamelCase)
           self.parent.assertEqual(
               result.logits.shape, (
                   self.batch_size,
                   self.num_labels,
                   self.image_size // self.output_stride,
                   self.image_size // self.output_stride,
               ), )
           _lowercase			:				List[Any] 						=						model(lowerCamelCase, labels=lowerCamelCase)
           self.parent.assertEqual(
               result.logits.shape, (
                   self.batch_size,
                   self.num_labels,
                   self.image_size // self.output_stride,
                   self.image_size // self.output_stride,
               ), )




       def      UpperCamelCase	(   self)			->  int:




           """simple docstring"""

           _lowercase			:				Tuple 						=						self.prepare_config_and_inputs()
           _lowercase						,							_lowercase						,							_lowercase						,							_lowercase			:				Dict 						=						config_and_inputs
           _lowercase			:				str 						=						{'pixel_values': pixel_values}
           return config, inputs_dict






@require_torch
class _lowerCamelCase(		_a,					_a,					unittest.TestCase  ):
       lowercase_					:      Union[str, Any]       					=     (
           (MobileNetVaModel, MobileNetVaForImageClassification, MobileNetVaForSemanticSegmentation)
           if is_torch_available()
           else ()
       )
       lowercase_					:      Optional[Any]       					=     (
           {
               """feature-extraction""": MobileNetVaModel,
               """image-classification""": MobileNetVaForImageClassification,
               """image-segmentation""": MobileNetVaForSemanticSegmentation,
           }
           if is_torch_available()
           else {}
       )

       lowercase_					:      Optional[Any]       					=     False
       lowercase_					:      List[Any]       					=     False
       lowercase_					:      Dict       					=     False
       lowercase_					:      List[str]       					=     False
       def      UpperCamelCase	(   self)			->  int:




           """simple docstring"""

           _lowercase			:				int 						=						MobileNetVaModelTester(self)
           _lowercase			:				Tuple 						=						MobileNetVaConfigTester(self, config_class=lowerCamelCase, has_text_modality=lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Optional[Any]:




           """simple docstring"""

           self.config_tester.run_common_tests()
       @unittest.skip(reason='MobileNetV2 does not use inputs_embeds')
       def      UpperCamelCase	(   self)			->  Union[str, Any]:




           """simple docstring"""

           pass
       @unittest.skip(reason='MobileNetV2 does not support input and output embeddings')
       def      UpperCamelCase	(   self)			->  Any:




           """simple docstring"""

           pass
       @unittest.skip(reason='MobileNetV2 does not output attentions')
       def      UpperCamelCase	(   self)			->  List[str]:




           """simple docstring"""

           pass
       def      UpperCamelCase	(   self)			->  Optional[int]:




           """simple docstring"""

           _lowercase						,							_lowercase			:				int 						=						self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
               _lowercase			:				Optional[Any] 						=						model_class(lowerCamelCase)
               _lowercase			:				Dict 						=						inspect.signature(model.forward)
               # signature.parameters is an OrderedDict => so arg_names order is deterministic
               _lowercase			:				List[str] 						=						[*signature.parameters.keys()]

               _lowercase			:				List[str] 						=						['pixel_values']
               self.assertListEqual(arg_names[:1], lowerCamelCase)
       def      UpperCamelCase	(   self)			->  List[Any]:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_model(*lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Any:




           """simple docstring"""

           def check_hidden_states_output(lowerCamelCase, lowerCamelCase, lowerCamelCase):
               _lowercase			:				Dict 						=						model_class(lowerCamelCase)
               model.to(lowerCamelCase)
               model.eval()

               with torch.no_grad():
                   _lowercase			:				str 						=						model(**self._prepare_for_class(lowerCamelCase, lowerCamelCase))

               _lowercase			:				str 						=						outputs.hidden_states

               _lowercase			:				Union[str, Any] 						=						16
               self.assertEqual(len(lowerCamelCase), lowerCamelCase)

           _lowercase						,							_lowercase			:				Optional[int] 						=						self.model_tester.prepare_config_and_inputs_for_common()

           for model_class in self.all_model_classes:
               _lowercase			:				str 						=						True
               check_hidden_states_output(lowerCamelCase, lowerCamelCase, lowerCamelCase)

               # check that output_hidden_states also work using config
               del inputs_dict["output_hidden_states"]
               _lowercase			:				int 						=						True

               check_hidden_states_output(lowerCamelCase, lowerCamelCase, lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Optional[Any]:




           """simple docstring"""

           _lowercase			:				Tuple 						=						self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_image_classification(*lowerCamelCase)
       def      UpperCamelCase	(   self)			->  Any:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_for_semantic_segmentation(*lowerCamelCase)




       @slow
       def      UpperCamelCase	(   self)			->  Optional[int]:




           """simple docstring"""

           for model_name in MOBILENET_V2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
               _lowercase			:				List[str] 						=						MobileNetVaModel.from_pretrained(lowerCamelCase)
               self.assertIsNotNone(lowerCamelCase)



def 							UpperCamelCase_( )       ->		Optional[int]:
    _lowercase			:				Union[str, Any] 						=						Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'					)
    return image






@require_torch
@require_vision
class _lowerCamelCase(		unittest.TestCase  ):
       @cached_property
       def      UpperCamelCase	(   self)			->  Dict:




           """simple docstring"""

           return (
               MobileNetVaImageProcessor.from_pretrained('google/mobilenet_v2_1.0_224') if is_vision_available() else None
           )
       @slow
       def      UpperCamelCase	(   self)			->  List[str]:




           """simple docstring"""

           _lowercase			:				str 						=						MobileNetVaForImageClassification.from_pretrained('google/mobilenet_v2_1.0_224').to(lowerCamelCase)

           _lowercase			:				Union[str, Any] 						=						self.default_image_processor
           _lowercase			:				Tuple 						=						prepare_img()
           _lowercase			:				Union[str, Any] 						=						image_processor(images=lowerCamelCase, return_tensors='pt').to(lowerCamelCase)

           # forward pass
           with torch.no_grad():
               _lowercase			:				List[Any] 						=						model(**lowerCamelCase)

           # verify the logits
           _lowercase			:				Union[str, Any] 						=						torch.Size((1, 10_01))
           self.assertEqual(outputs.logits.shape, lowerCamelCase)

           _lowercase			:				str 						=						torch.tensor([0.2_4_4_5, -1.1_9_9_3, 0.1_9_0_5]).to(lowerCamelCase)

           self.assertTrue(torch.allclose(outputs.logits[0, :3], lowerCamelCase, atol=1E-4))




       @slow
       def      UpperCamelCase	(   self)			->  List[Any]:




           """simple docstring"""

           _lowercase			:				Optional[Any] 						=						MobileNetVaForSemanticSegmentation.from_pretrained('google/deeplabv3_mobilenet_v2_1.0_513')
           _lowercase			:				Union[str, Any] 						=						model.to(lowerCamelCase)

           _lowercase			:				int 						=						MobileNetVaImageProcessor.from_pretrained('google/deeplabv3_mobilenet_v2_1.0_513')

           _lowercase			:				Tuple 						=						prepare_img()
           _lowercase			:				Any 						=						image_processor(images=lowerCamelCase, return_tensors='pt').to(lowerCamelCase)

           # forward pass
           with torch.no_grad():
               _lowercase			:				Tuple 						=						model(**lowerCamelCase)
           _lowercase			:				List[str] 						=						outputs.logits

           # verify the logits
           _lowercase			:				Any 						=						torch.Size((1, 21, 65, 65))
           self.assertEqual(logits.shape, lowerCamelCase)

           _lowercase			:				Optional[int] 						=						torch.tensor(
               [
                   [[1_7.5_7_9_0, 1_7.7_5_8_1, 1_8.3_3_5_5], [1_8.3_2_5_7, 1_8.4_2_3_0, 1_8.8_9_7_3], [1_8.6_1_6_9, 1_8.8_6_5_0, 1_9.2_1_8_7]],
                   [[-2.1_5_9_5, -2.0_9_7_7, -2.3_7_4_1], [-2.4_2_2_6, -2.3_0_2_8, -2.6_8_3_5], [-2.7_8_1_9, -2.5_9_9_1, -2.7_7_0_6]],
                   [[4.2_0_5_8, 4.8_3_1_7, 4.7_6_3_8], [4.4_1_3_6, 5.0_3_6_1, 4.9_3_8_3], [4.5_0_2_8, 4.9_6_4_4, 4.8_7_3_4]],
               ], device=lowerCamelCase, )

           self.assertTrue(torch.allclose(logits[0, :3, :3, :3], lowerCamelCase, atol=1E-4))






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

lowerCAmelCase       		=    random.Random()




def     __SCREAMING_SNAKE_CASE							(       lowercase_      ,       lowercase_=1.0      ,       lowercase_=None      ,       lowercase_=None      )		->     Union[str, Any]:




						'''simple docstring'''







						if rng is None:
												__UpperCAmelCase			:							str	    =	global_rng

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

						return values




class 							lowerCamelCase   (  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				,     ):
							__UpperCAmelCase			:							Optional[Any]	    =	parent
							__UpperCAmelCase			:							Any	    =	batch_size
							__UpperCAmelCase			:							int	    =	min_seq_length
							__UpperCAmelCase			:							List[str]	    =	max_seq_length
							__UpperCAmelCase			:							Dict	    =	(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
							__UpperCAmelCase			:							Any	    =	spectrogram_length
							__UpperCAmelCase			:							List[Any]	    =	feature_size
							__UpperCAmelCase			:							Union[str, Any]	    =	num_audio_channels
							__UpperCAmelCase			:							Optional[int]	    =	hop_length
							__UpperCAmelCase			:							Tuple	    =	chunk_length
							__UpperCAmelCase			:							Any	    =	sampling_rate


	def  A(    self):
							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):
							def _flatten(lowercase__):
													return list(itertools.chain(*lowercase__))

							if equal_length:
													__UpperCAmelCase			:							str	    =	[floats_list((self.max_seq_length, self.feature_size)) for _ in range(self.batch_size)]
							else:
													# make sure that inputs increase in size
													__UpperCAmelCase			:							List[str]	    =	[
													    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			:							List[str]	    =	[np.asarray(lowercase__) for x in speech_inputs]
							return speech_inputs






@require_torch
@require_torchaudio
class 							lowerCamelCase   (  _UpperCamelCase							,						unittest.TestCase ):
	_lowerCAmelCase     :		Optional[int]										=						TvltFeatureExtractor


	def  A(    self):
							__UpperCAmelCase			:							Dict	    =	TvltFeatureExtractionTester(self)


	def  A(    self):
							__UpperCAmelCase			:							Optional[int]	    =	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):
							__UpperCAmelCase			:							str	    =	self.feature_extraction_class(**self.feat_extract_dict)

							with tempfile.TemporaryDirectory() as tmpdirname:
													__UpperCAmelCase			:							str	    =	feat_extract_first.save_pretrained(lowercase__)[0]
													check_json_file_has_correct_format(lowercase__)
													__UpperCAmelCase			:							Optional[int]	    =	self.feature_extraction_class.from_pretrained(lowercase__)

							__UpperCAmelCase			:							List[Any]	    =	feat_extract_first.to_dict()
							__UpperCAmelCase			:							Union[str, Any]	    =	feat_extract_second.to_dict()
							__UpperCAmelCase			:							Union[str, Any]	    =	dict_first.pop('''mel_filters''')
							__UpperCAmelCase			:							Union[str, Any]	    =	dict_second.pop('''mel_filters''')
							self.assertTrue(np.allclose(lowercase__				,     lowercase__))
							self.assertEqual(lowercase__				,     lowercase__)


	def  A(    self):
							__UpperCAmelCase			:							Optional[int]	    =	self.feature_extraction_class(**self.feat_extract_dict)

							with tempfile.TemporaryDirectory() as tmpdirname:
													__UpperCAmelCase			:							Union[str, Any]	    =	os.path.join(lowercase__				,     '''feat_extract.json''')
													feat_extract_first.to_json_file(lowercase__)
													__UpperCAmelCase			:							str	    =	self.feature_extraction_class.from_json_file(lowercase__)

							__UpperCAmelCase			:							Any	    =	feat_extract_first.to_dict()
							__UpperCAmelCase			:							Union[str, Any]	    =	feat_extract_second.to_dict()
							__UpperCAmelCase			:							Tuple	    =	dict_first.pop('''mel_filters''')
							__UpperCAmelCase			:							List[str]	    =	dict_second.pop('''mel_filters''')
							self.assertTrue(np.allclose(lowercase__				,     lowercase__))
							self.assertEqual(lowercase__				,     lowercase__)


	def  A(    self):
							# Initialize feature_extractor
							__UpperCAmelCase			:							Optional[int]	    =	self.feature_extraction_class(**self.feat_extract_dict)

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

							# Test not batched input
							__UpperCAmelCase			:							Dict	    =	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			:							List[str]	    =	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			:							Tuple	    =	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			:							Any	    =	[floats_list((1, x))[0] for x in (8_0_0, 8_0_0, 8_0_0)]
							__UpperCAmelCase			:							Optional[Any]	    =	np.asarray(lowercase__)
							__UpperCAmelCase			:							Tuple	    =	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__):
							__UpperCAmelCase			:							Optional[int]	    =	load_dataset('''hf-internal-testing/librispeech_asr_dummy'''				,     '''clean'''				,     split='''validation''')
							# automatic decoding with librispeech
							__UpperCAmelCase			:							int	    =	ds.sort('''id''').select(range(lowercase__))[:num_samples]['''audio''']

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


	def  A(    self):
							__UpperCAmelCase			:							Optional[Any]	    =	self._load_datasamples(1)
							__UpperCAmelCase			:							Tuple	    =	TvltFeatureExtractor()
							__UpperCAmelCase			:							Tuple	    =	feature_extractor(lowercase__				,     return_tensors='''pt''').audio_values

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

							__UpperCAmelCase			:							int	    =	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))

