code: 
  
  
  from __future__ import annotations
  
  import unittest
  
  from transformers import AlbertConfig, is_tf_available
  from transformers.models.auto import get_values
  from transformers.testing_utils import require_tf, slow
  
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor, random_attention_mask
  from ...test_pipeline_mixin import PipelineTesterMixin
  
  
  if is_tf_available():
      import tensorflow as tf
  
      from transformers import TF_MODEL_FOR_PRETRAINING_MAPPING
      from transformers.models.albert.modeling_tf_albert import (
          TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFAlbertForMaskedLM,
          TFAlbertForMultipleChoice,
          TFAlbertForPreTraining,
          TFAlbertForQuestionAnswering,
          TFAlbertForSequenceClassification,
          TFAlbertForTokenClassification,
          TFAlbertModel,
      )
  
  
  
  
  
  class   __lowerCamelCase :
  
  
  
  
  
  
  
         def __init__( self:   str,A_:   List[str],A_:   int=13,A_:   Optional[int]=7,A_:   Optional[Any]=True,A_:   int=True,A_:   Tuple=True,A_:   Tuple=True,A_:   List[Any]=99,A_:   Union[str, Any]=16,A_:   Optional[Any]=32,A_:   Any=2,A_:   Tuple=4,A_:   Optional[Any]=37,A_:   str="gelu",A_:   int=0.1,A_:   Union[str, Any]=0.1,A_:   Optional[int]=512,A_:   Dict=16,A_:   List[Any]=2,A_:   List[Any]=0.0_2,A_:   Tuple=3,A_:   Any=4,A_:   str=None,):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = parent
              __UpperCamelCase   = 13
              __UpperCamelCase   = 7
              __UpperCamelCase   = True
              __UpperCamelCase   = True
              __UpperCamelCase   = True
              __UpperCamelCase   = True
              __UpperCamelCase   = 99
              __UpperCamelCase   = 16
              __UpperCamelCase   = 32
              __UpperCamelCase   = 2
              __UpperCamelCase   = 4
              __UpperCamelCase   = 37
              __UpperCamelCase   = 'gelu'
              __UpperCamelCase   = 0.1
              __UpperCamelCase   = 0.1
              __UpperCamelCase   = 512
              __UpperCamelCase   = 16
              __UpperCamelCase   = 2
              __UpperCamelCase   = 0.0_2
              __UpperCamelCase   = 3
              __UpperCamelCase   = 4
              __UpperCamelCase   = None
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   int				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __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   = None
              if self.use_token_type_ids:
                   __UpperCamelCase   = ids_tensor([self.batch_size, self.seq_length],self.type_vocab_size				)
  
              __UpperCamelCase   = None
              __UpperCamelCase   = None
              __UpperCamelCase   = None
              if self.use_labels:
                   __UpperCamelCase   = ids_tensor([self.batch_size],self.type_sequence_label_size				)
                   __UpperCamelCase   = ids_tensor([self.batch_size, self.seq_length],self.num_labels				)
                   __UpperCamelCase   = ids_tensor([self.batch_size],self.num_choices				)
  
              __UpperCamelCase   = AlbertConfig(
                  vocab_size=self.vocab_size,hidden_size=self.hidden_size,embedding_size=self.embedding_size,num_hidden_layers=self.num_hidden_layers,num_attention_heads=self.num_attention_heads,intermediate_size=self.intermediate_size,hidden_act=self.hidden_act,hidden_dropout_prob=self.hidden_dropout_prob,attention_probs_dropout_prob=self.attention_probs_dropout_prob,max_position_embeddings=self.max_position_embeddings,type_vocab_size=self.type_vocab_size,initializer_range=self.initializer_range,)
  
              return config, input_ids, token_type_ids, input_mask, sequence_labels, token_labels, choice_labels
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   int,A_:   int,A_:   int,A_:   Tuple,A_:   int,A_:   Optional[Any],A_:   int,A_:   int				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = TFAlbertModel(config=lowerCAmelCase_				)
              # inputs = {'input_ids': input_ids,
              #           'attention_mask': input_mask,
              #           'token_type_ids': token_type_ids}
              # sequence_output, pooled_output = model(**inputs)
              __UpperCamelCase   = {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
              __UpperCamelCase   = model(lowerCAmelCase_				)
  
              __UpperCamelCase   = [input_ids, input_mask]
              __UpperCamelCase   = model(lowerCAmelCase_				)
  
              __UpperCamelCase   = model(lowerCAmelCase_				)
  
              self.parent.assertEqual(result.last_hidden_state.shape,(self.batch_size, self.seq_length, self.hidden_size)				)
              self.parent.assertEqual(result.pooler_output.shape,(self.batch_size, self.hidden_size)				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   List[Any],A_:   Dict,A_:   Union[str, Any],A_:   str,A_:   Dict,A_:   Any,A_:   Optional[Any],A_:   List[str]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.num_labels
              __UpperCamelCase   = TFAlbertForPreTraining(config=lowerCAmelCase_				)
              __UpperCamelCase   = {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
              __UpperCamelCase   = model(lowerCAmelCase_				)
              self.parent.assertEqual(result.prediction_logits.shape,(self.batch_size, self.seq_length, self.vocab_size)				)
              self.parent.assertEqual(result.sop_logits.shape,(self.batch_size, self.num_labels)				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   List[Any],A_:   List[str],A_:   Any,A_:   Union[str, Any],A_:   int,A_:   Any,A_:   Union[str, Any],A_:   Tuple				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = TFAlbertForMaskedLM(config=lowerCAmelCase_				)
              __UpperCamelCase   = {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
              __UpperCamelCase   = model(lowerCAmelCase_				)
              self.parent.assertEqual(result.logits.shape,(self.batch_size, self.seq_length, self.vocab_size)				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   List[str],A_:   Dict,A_:   Tuple,A_:   Union[str, Any],A_:   Union[str, Any],A_:   Union[str, Any],A_:   Dict,A_:   Union[str, Any]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.num_labels
              __UpperCamelCase   = TFAlbertForSequenceClassification(config=lowerCAmelCase_				)
              __UpperCamelCase   = {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
              __UpperCamelCase   = model(lowerCAmelCase_				)
              self.parent.assertEqual(result.logits.shape,(self.batch_size, self.num_labels)				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Any,A_:   Union[str, Any],A_:   List[str],A_:   int,A_:   Tuple,A_:   Dict,A_:   Optional[Any],A_:   int				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = TFAlbertForQuestionAnswering(config=lowerCAmelCase_				)
              __UpperCamelCase   = {'input_ids': input_ids, 'attention_mask': input_mask, 'token_type_ids': token_type_ids}
              __UpperCamelCase   = model(lowerCAmelCase_				)
              self.parent.assertEqual(result.start_logits.shape,(self.batch_size, self.seq_length)				)
              self.parent.assertEqual(result.end_logits.shape,(self.batch_size, self.seq_length)				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Union[str, Any],A_:   Dict,A_:   str,A_:   List[Any],A_:   Tuple,A_:   Optional[Any],A_:   str,A_:   str				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.num_choices
              __UpperCamelCase   = TFAlbertForMultipleChoice(config=lowerCAmelCase_				)
              __UpperCamelCase   = tf.tile(tf.expand_dims(lowerCAmelCase_,1				),(1, self.num_choices, 1)				)
              __UpperCamelCase   = tf.tile(tf.expand_dims(lowerCAmelCase_,1				),(1, self.num_choices, 1)				)
              __UpperCamelCase   = tf.tile(tf.expand_dims(lowerCAmelCase_,1				),(1, self.num_choices, 1)				)
              __UpperCamelCase   = {
                  'input_ids': multiple_choice_inputs_ids,
                  'attention_mask': multiple_choice_input_mask,
                  'token_type_ids': multiple_choice_token_type_ids,
              }
              __UpperCamelCase   = model(lowerCAmelCase_				)
              self.parent.assertListEqual(list(result['logits'].shape				),[self.batch_size, self.num_choices]				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Any,A_:   Any,A_:   int,A_:   Any,A_:   Tuple,A_:   Dict,A_:   List[str],A_:   Optional[Any]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.num_labels
              __UpperCamelCase   = TFAlbertForTokenClassification(config=lowerCAmelCase_				)
              __UpperCamelCase   = {
                  'input_ids': input_ids,
                  'attention_mask': input_mask,
                  'token_type_ids': token_type_ids,
              }
              __UpperCamelCase   = model(lowerCAmelCase_				)
              self.parent.assertListEqual(list(result['logits'].shape				),[self.batch_size, self.seq_length, self.num_labels]				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Any				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.prepare_config_and_inputs()
              (
                  (
                  __UpperCamelCase
              ),						(
                  __UpperCamelCase
              ),						(
                  __UpperCamelCase
              ),						(
                  __UpperCamelCase
              ),						(
                  __UpperCamelCase
              ),						(
                  __UpperCamelCase
              ),						(
                  __UpperCamelCase
              ),						
              )   = config_and_inputs
              __UpperCamelCase   = {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': input_mask}
              return config, inputs_dict
  
  
  
  
  
  @require_tf
  class   __lowerCamelCase (lowerCAmelCase__							,			lowerCAmelCase__							,			unittest.TestCase	):
         _lowercase       							=    (
             (
                 TFAlbertModel,
                 TFAlbertForPreTraining,
                 TFAlbertForMaskedLM,
                 TFAlbertForSequenceClassification,
                 TFAlbertForQuestionAnswering,
                 TFAlbertForTokenClassification,
                 TFAlbertForMultipleChoice,
             )
             if is_tf_available()
             else ()
         )
         _lowercase       							=    (
             {
                 """feature-extraction""": TFAlbertModel,
                 """fill-mask""": TFAlbertForMaskedLM,
                 """question-answering""": TFAlbertForQuestionAnswering,
                 """text-classification""": TFAlbertForSequenceClassification,
                 """token-classification""": TFAlbertForTokenClassification,
                 """zero-shot""": TFAlbertForSequenceClassification,
             }
             if is_tf_available()
             else {}
         )
         _lowercase       							=    False
         _lowercase       							=    False
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Dict,A_:   Dict,A_:   Optional[int],A_:   str=False				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = super()._prepare_for_class(lowerCAmelCase_,lowerCAmelCase_,return_labels=lowerCAmelCase_				)
  
              if return_labels:
                   if model_class in get_values(lowerCAmelCase_				):
                        __UpperCamelCase   = tf.zeros(self.model_tester.batch_size,dtype=tf.intaa				)
  
              return inputs_dict
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Tuple				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = TFAlbertModelTester(self				)
              __UpperCamelCase   = ConfigTester(self,config_class=lowerCAmelCase_,hidden_size=37				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   str				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              self.config_tester.run_common_tests()
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Optional[Any]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_albert_model(*lowerCAmelCase_				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   str				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_albert_for_pretraining(*lowerCAmelCase_				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   int				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_albert_for_masked_lm(*lowerCAmelCase_				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   str				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_albert_for_multiple_choice(*lowerCAmelCase_				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Optional[Any]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_albert_for_sequence_classification(*lowerCAmelCase_				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   int				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.model_tester.prepare_config_and_inputs()
              self.model_tester.create_and_check_albert_for_question_answering(*lowerCAmelCase_				)
  
  
  
  
  
  
  
         @slow
         def 		snake_case_  ( self:   Tuple				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              for model_name in TF_ALBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                   __UpperCamelCase   = TFAlbertModel.from_pretrained(lowerCAmelCase_				)
                   self.assertIsNotNone(lowerCAmelCase_				)
  
  
  
  
  
  @require_tf
  class   __lowerCamelCase (unittest.TestCase	):
  
  
  
  
  
  
  
         @slow
         def 		snake_case_  ( self:   Dict				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = TFAlbertForPreTraining.from_pretrained('albert-base-v2'				)
              __UpperCamelCase   = tf.constant([[0, 1, 2, 3, 4, 5]]				)
              __UpperCamelCase   = model(lowerCAmelCase_				)[0]
  
              __UpperCamelCase   = [1, 6, 3_0000]
              self.assertEqual(output.shape,lowerCAmelCase_				)
  
              __UpperCamelCase   = tf.constant(
                  [
                      [
                          [4.5_9_5_6_6_8, 0.7_4_4_6_2_7_5_4, -1.8_1_8_1_4_7],
                          [4.5_9_5_4_3_4_7, 0.7_4_5_4_1_8_4, -1.8_1_8_8_2_5_8],
                          [4.5_9_5_4_9_0_5, 0.7_4_4_8_2_3_5, -1.8_1_8_2_3_1_6],
                      ]
                  ]				)
              tf.debugging.assert_near(output[:, :3, :3],lowerCAmelCase_,atol=1E-4				)
  
  
  
style_context: 
  
  
  import unittest
  
  import numpy as np
  
  from transformers.testing_utils import require_torch, require_vision
  from transformers.utils import is_torch_available, is_vision_available
  
  from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs
  
  
  if is_torch_available():
      import torch
  
  if is_vision_available():
      from PIL import Image
  
      from transformers import DeiTImageProcessor
  
  
  
  class   __lowerCamelCase (unittest.TestCase	):
  
  
  
  
  
  
  
         def __init__( self:   List[str],A_:   List[Any],A_:   List[Any]=7,A_:   str=3,A_:   Tuple=18,A_:   Union[str, Any]=30,A_:   Union[str, Any]=400,A_:   List[str]=True,A_:   List[Any]=None,A_:   Tuple=True,A_:   Union[str, Any]=None,A_:   int=True,A_:   Any=[0.5, 0.5, 0.5],A_:   Optional[Any]=[0.5, 0.5, 0.5],):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = size if size is not None else {'height': 20, 'width': 20}
              __UpperCamelCase   = crop_size if crop_size is not None else {'height': 18, 'width': 18}
  
              __UpperCamelCase   = parent
              __UpperCamelCase   = batch_size
              __UpperCamelCase   = num_channels
              __UpperCamelCase   = image_size
              __UpperCamelCase   = min_resolution
              __UpperCamelCase   = max_resolution
              __UpperCamelCase   = do_resize
              __UpperCamelCase   = size
              __UpperCamelCase   = do_center_crop
              __UpperCamelCase   = crop_size
              __UpperCamelCase   = do_normalize
              __UpperCamelCase   = image_mean
              __UpperCamelCase   = image_std
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   List[str]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              return {
                  "do_resize": self.do_resize,
                  "size": self.size,
                  "do_center_crop": self.do_center_crop,
                  "crop_size": self.crop_size,
                  "do_normalize": self.do_normalize,
                  "image_mean": self.image_mean,
                  "image_std": self.image_std,
              }
  
  
  
  @require_torch
  @require_vision
  class   __lowerCamelCase (_a							,			unittest.TestCase	):
         _lowercase       							=    DeiTImageProcessor if is_vision_available() else None
         _lowercase       							=    True
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   List[Any]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = DeiTImageProcessingTester(self				)
  
  
  
  
  
  
  
         @property
         def 		snake_case_  ( self:   Optional[int]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              return self.image_processor_tester.prepare_image_processor_dict()
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Union[str, Any]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.image_processing_class(**self.image_processor_dict				)
              self.assertTrue(hasattr(A_,'do_resize'				)				)
              self.assertTrue(hasattr(A_,'size'				)				)
              self.assertTrue(hasattr(A_,'do_center_crop'				)				)
              self.assertTrue(hasattr(A_,'center_crop'				)				)
              self.assertTrue(hasattr(A_,'do_normalize'				)				)
              self.assertTrue(hasattr(A_,'image_mean'				)				)
              self.assertTrue(hasattr(A_,'image_std'				)				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Optional[int]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.image_processing_class.from_dict(self.image_processor_dict				)
              self.assertEqual(image_processor.size,{'height': 20, 'width': 20}				)
              self.assertEqual(image_processor.crop_size,{'height': 18, 'width': 18}				)
  
              __UpperCamelCase   = self.image_processing_class.from_dict(self.image_processor_dict,size=42,crop_size=84				)
              self.assertEqual(image_processor.size,{'height': 42, 'width': 42}				)
              self.assertEqual(image_processor.crop_size,{'height': 84, 'width': 84}				)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Tuple				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              pass
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Optional[int]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.image_processing_class(**self.image_processor_dict				)
              # create random PIL images
              __UpperCamelCase   = prepare_image_inputs(self.image_processor_tester,equal_resolution=A_				)
              for image in image_inputs:
                   self.assertIsInstance(A_,Image.Image				)
  
              # Test not batched input
              __UpperCamelCase   = image_processing(image_inputs[0],return_tensors='pt'				).pixel_values
              self.assertEqual(
                  encoded_images.shape,(
                      1,
                      self.image_processor_tester.num_channels,
                      self.image_processor_tester.crop_size['height'],
                      self.image_processor_tester.crop_size['width'],
                  ),)
  
              # Test batched
              __UpperCamelCase   = image_processing(A_,return_tensors='pt'				).pixel_values
              self.assertEqual(
                  encoded_images.shape,(
                      self.image_processor_tester.batch_size,
                      self.image_processor_tester.num_channels,
                      self.image_processor_tester.crop_size['height'],
                      self.image_processor_tester.crop_size['width'],
                  ),)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   List[str]				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.image_processing_class(**self.image_processor_dict				)
              # create random numpy tensors
              __UpperCamelCase   = prepare_image_inputs(self.image_processor_tester,equal_resolution=A_,numpify=A_				)
              for image in image_inputs:
                   self.assertIsInstance(A_,np.ndarray				)
  
              # Test not batched input
              __UpperCamelCase   = image_processing(image_inputs[0],return_tensors='pt'				).pixel_values
              self.assertEqual(
                  encoded_images.shape,(
                      1,
                      self.image_processor_tester.num_channels,
                      self.image_processor_tester.crop_size['height'],
                      self.image_processor_tester.crop_size['width'],
                  ),)
  
              # Test batched
              __UpperCamelCase   = image_processing(A_,return_tensors='pt'				).pixel_values
              self.assertEqual(
                  encoded_images.shape,(
                      self.image_processor_tester.batch_size,
                      self.image_processor_tester.num_channels,
                      self.image_processor_tester.crop_size['height'],
                      self.image_processor_tester.crop_size['width'],
                  ),)
  
  
  
  
  
  
  
         def 		snake_case_  ( self:   Any				):
  
  
  
  
  
  
              '''simple docstring'''
  
  
  
  
              __UpperCamelCase   = self.image_processing_class(**self.image_processor_dict				)
              # create random PyTorch tensors
              __UpperCamelCase   = prepare_image_inputs(self.image_processor_tester,equal_resolution=A_,torchify=A_				)
              for image in image_inputs:
                   self.assertIsInstance(A_,torch.Tensor				)
  
              # Test not batched input
              __UpperCamelCase   = image_processing(image_inputs[0],return_tensors='pt'				).pixel_values
              self.assertEqual(
                  encoded_images.shape,(
                      1,
                      self.image_processor_tester.num_channels,
                      self.image_processor_tester.crop_size['height'],
                      self.image_processor_tester.crop_size['width'],
                  ),)
  
              # Test batched
              __UpperCamelCase   = image_processing(A_,return_tensors='pt'				).pixel_values
              self.assertEqual(
                  encoded_images.shape,(
                      self.image_processor_tester.batch_size,
                      self.image_processor_tester.num_channels,
                      self.image_processor_tester.crop_size['height'],
                      self.image_processor_tester.crop_size['width'],
                  ),)
  
  
  