





'''simple docstring'''







from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig, OnnxConfigWithPast, OnnxSeqaSeqConfigWithPast
from ...onnx.utils import compute_effective_axis_dimension
from ...utils import TensorType, is_torch_available, logging


snake_case_       :    Optional[Any]          =					logging.get_logger(__name__)

snake_case_       :    List[Any]          =					{
    "google/bigbird-pegasus-large-arxiv": (
        "https://huggingface.co/google/bigbird-pegasus-large-arxiv/resolve/main/config.json"
    ),
    "google/bigbird-pegasus-large-pubmed": (
        "https://huggingface.co/google/bigbird-pegasus-large-pubmed/resolve/main/config.json"
    ),
    "google/bigbird-pegasus-large-bigpatent": (
        "https://huggingface.co/google/bigbird-pegasus-large-bigpatent/resolve/main/config.json"
    ),
    # See all BigBirdPegasus models at https://huggingface.co/models?filter=bigbird_pegasus
}


class    __a (lowerCamelCase       ):
							__a   :				List[Any]       =    "bigbird_pegasus"
							__a   :				Any       =    ["past_key_values"]
							__a   :				List[Any]       =    {
							    "num_attention_heads": "encoder_attention_heads",
							    "hidden_size": "d_model",
							    "attention_probs_dropout_prob": "attention_dropout",
							}

							def __init__(							self							:       str    ,       __magic_name__							:       Tuple=9_61_03    ,       __magic_name__							:       Dict=40_96    ,       __magic_name__							:       int=16    ,       __magic_name__							:       Any=40_96    ,       __magic_name__							:       Any=16    ,       __magic_name__							:       List[Any]=16    ,       __magic_name__							:       Optional[int]=40_96    ,       __magic_name__							:       Tuple=16    ,       __magic_name__							:       Optional[Any]=0.0    ,       __magic_name__							:       Union[str, Any]=0.0    ,       __magic_name__							:       Any=True    ,       __magic_name__							:       int=True    ,       __magic_name__							:       int="gelu_new"    ,       __magic_name__							:       List[str]=10_24    ,       __magic_name__							:       str=0.1    ,       __magic_name__							:       List[Any]=0.0    ,       __magic_name__							:       List[Any]=0.0    ,       __magic_name__							:       Tuple=0.0_2    ,       __magic_name__							:       str=2    ,       __magic_name__							:       int=0.0    ,       __magic_name__							:       Any=True    ,       __magic_name__							:       Tuple=0    ,       __magic_name__							:       str=2    ,       __magic_name__							:       List[Any]=1    ,       __magic_name__							:       Optional[Any]="block_sparse"    ,       __magic_name__							:       Optional[int]=64    ,       __magic_name__							:       Optional[int]=3    ,       __magic_name__							:       Any=False    ,       **__magic_name__							:       Union[str, Any]    ,       )   ->    Dict:







													"""simple docstring"""
													UpperCAmelCase_     : int         =					vocab_size
													UpperCAmelCase_     : Tuple         =					max_position_embeddings
													UpperCAmelCase_     : Optional[int]         =					d_model
													UpperCAmelCase_     : List[str]         =					encoder_ffn_dim
													UpperCAmelCase_     : List[Any]         =					encoder_layers
													UpperCAmelCase_     : Optional[Any]         =					encoder_attention_heads
													UpperCAmelCase_     : Optional[int]         =					decoder_ffn_dim
													UpperCAmelCase_     : Any         =					decoder_layers
													UpperCAmelCase_     : List[str]         =					decoder_attention_heads
													UpperCAmelCase_     : Any         =					dropout
													UpperCAmelCase_     : Optional[Any]         =					attention_dropout
													UpperCAmelCase_     : Dict         =					activation_dropout
													UpperCAmelCase_     : List[Any]         =					activation_function
													UpperCAmelCase_     : List[str]         =					init_std
													UpperCAmelCase_     : List[Any]         =					encoder_layerdrop
													UpperCAmelCase_     : Tuple         =					decoder_layerdrop
													UpperCAmelCase_     : Dict         =					classifier_dropout
													UpperCAmelCase_     : Tuple         =					use_cache
													UpperCAmelCase_     : Union[str, Any]         =					encoder_layers
													UpperCAmelCase_     : Dict         =					scale_embedding  # scale factor will be sqrt(d_model) if True

													# extra config
													UpperCAmelCase_     : Tuple         =					attention_type
													UpperCAmelCase_     : Optional[int]         =					block_size
													UpperCAmelCase_     : Dict         =					num_random_blocks
													UpperCAmelCase_     : List[str]         =					use_bias

													super().__init__(
													    pad_token_id=__magic_name__    ,       bos_token_id=__magic_name__    ,       eos_token_id=__magic_name__    ,       is_encoder_decoder=__magic_name__    ,       decoder_start_token_id=__magic_name__    ,       **__magic_name__    ,       )





class    __a (lowerCamelCase       ):

							@property
							def       UpperCAmelCase__		(							self							:       List[Any]				)   ->    Mapping[str, Mapping[int, str]]:







													"""simple docstring"""
													if self.task in ["default", "seq2seq-lm"]:
																			UpperCAmelCase_     : str         =					OrderedDict(
																			    [
																			        ('''input_ids''', {0: '''batch''', 1: '''encoder_sequence'''}),
																			        ('''attention_mask''', {0: '''batch''', 1: '''encoder_sequence'''}),
																			    ]				)

																			if self.use_past:
																									UpperCAmelCase_     : List[str]         =					{0: '''batch'''}
																									UpperCAmelCase_     : str         =					{0: '''batch''', 1: '''past_decoder_sequence + sequence'''}
																			else:
																									UpperCAmelCase_     : Any         =					{0: '''batch''', 1: '''decoder_sequence'''}
																									UpperCAmelCase_     : List[str]         =					{0: '''batch''', 1: '''decoder_sequence'''}

																			if self.use_past:
																									self.fill_with_past_key_values_(__magic_name__    ,       direction='''inputs'''				)
													elif self.task == "causal-lm":
																			# TODO: figure this case out.
																			UpperCAmelCase_     : Any         =					OrderedDict(
																			    [
																			        ('''input_ids''', {0: '''batch''', 1: '''encoder_sequence'''}),
																			        ('''attention_mask''', {0: '''batch''', 1: '''encoder_sequence'''}),
																			    ]				)
																			if self.use_past:
																									UpperCAmelCase_     : Dict         =					self.num_layers
																									for i in range(__magic_name__				):
																															UpperCAmelCase_     : Optional[Any]         =					{0: '''batch''', 2: '''past_sequence + sequence'''}
																															UpperCAmelCase_     : Dict         =					{0: '''batch''', 2: '''past_sequence + sequence'''}
													else:
																			UpperCAmelCase_     : Optional[int]         =					OrderedDict(
																			    [
																			        ('''input_ids''', {0: '''batch''', 1: '''encoder_sequence'''}),
																			        ('''attention_mask''', {0: '''batch''', 1: '''encoder_sequence'''}),
																			        ('''decoder_input_ids''', {0: '''batch''', 1: '''decoder_sequence'''}),
																			        ('''decoder_attention_mask''', {0: '''batch''', 1: '''decoder_sequence'''}),
																			    ]				)

													return common_inputs

							@property
							def       UpperCAmelCase__		(							self							:       Tuple				)   ->    Mapping[str, Mapping[int, str]]:







													"""simple docstring"""
													if self.task in ["default", "seq2seq-lm"]:
																			UpperCAmelCase_     : Optional[Any]         =					super().outputs
													else:
																			UpperCAmelCase_     : Dict         =					super(__magic_name__    ,       self				).outputs
																			if self.use_past:
																									UpperCAmelCase_     : int         =					self.num_layers
																									for i in range(__magic_name__				):
																															UpperCAmelCase_     : Dict         =					{0: '''batch''', 2: '''past_sequence + sequence'''}
																															UpperCAmelCase_     : str         =					{0: '''batch''', 2: '''past_sequence + sequence'''}
													return common_outputs

							def       UpperCAmelCase__		(							self							:       Dict    ,       __magic_name__							:       PreTrainedTokenizer    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       bool = False    ,       __magic_name__							:       Optional[TensorType] = None    ,       )   ->    Mapping[str, Any]:







													"""simple docstring"""
													UpperCAmelCase_     : int         =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
													    __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__				)

													# Generate decoder inputs
													UpperCAmelCase_     : Tuple         =					seq_length if not self.use_past else 1
													UpperCAmelCase_     : int         =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
													    __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__				)
													UpperCAmelCase_     : Optional[int]         =					{F"""decoder_{name}""": tensor for name, tensor in decoder_inputs.items()}
													UpperCAmelCase_     : List[str]         =					dict(**__magic_name__    ,       **__magic_name__				)

													if self.use_past:
																			if not is_torch_available():
																									raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.'''				)
																			else:
																									import torch
																			UpperCAmelCase_     : Any         =					common_inputs['''input_ids'''].shape
																			UpperCAmelCase_     : Any         =					common_inputs['''decoder_input_ids'''].shape[1]
																			UpperCAmelCase_     : Any         =					self.num_attention_heads
																			UpperCAmelCase_     : Optional[Any]         =					(
																			    batch,
																			    num_encoder_attention_heads,
																			    encoder_seq_length,
																			    self._config.hidden_size // num_encoder_attention_heads,
																			)
																			UpperCAmelCase_     : str         =					decoder_seq_length + 3
																			UpperCAmelCase_     : List[Any]         =					(
																			    batch,
																			    num_decoder_attention_heads,
																			    decoder_past_length,
																			    self._config.hidden_size // num_decoder_attention_heads,
																			)

																			UpperCAmelCase_     : Optional[int]         =					torch.cat(
																			    [common_inputs['''decoder_attention_mask'''], torch.ones(__magic_name__    ,       __magic_name__				)]    ,       dim=1				)

																			UpperCAmelCase_     : List[str]         =					[]
																			# If the number of encoder and decoder layers are present in the model configuration, both are considered
																			UpperCAmelCase_     : Tuple         =					self.num_layers
																			UpperCAmelCase_     : Any         =					min(__magic_name__    ,       __magic_name__				)
																			UpperCAmelCase_     : Any         =					max(__magic_name__    ,       __magic_name__				) - min_num_layers
																			UpperCAmelCase_     : Union[str, Any]         =					'''encoder''' if num_encoder_layers > num_decoder_layers else '''decoder'''

																			for _ in range(__magic_name__				):
																									common_inputs["past_key_values"].append(
																									    (
																									        torch.zeros(__magic_name__				),
																									        torch.zeros(__magic_name__				),
																									        torch.zeros(__magic_name__				),
																									        torch.zeros(__magic_name__				),
																									    )				)
																			# TODO: test this.
																			UpperCAmelCase_     : Optional[int]         =					encoder_shape if remaining_side_name == '''encoder''' else decoder_shape
																			for _ in range(__magic_name__    ,       __magic_name__				):
																									common_inputs["past_key_values"].append((torch.zeros(__magic_name__				), torch.zeros(__magic_name__				))				)
													return common_inputs

							def       UpperCAmelCase__		(							self							:       Union[str, Any]    ,       __magic_name__							:       PreTrainedTokenizer    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       bool = False    ,       __magic_name__							:       Optional[TensorType] = None    ,       )   ->    Mapping[str, Any]:







													"""simple docstring"""
													UpperCAmelCase_     : str         =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
													    __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__				)

													if self.use_past:
																			if not is_torch_available():
																									raise ValueError('''Cannot generate dummy past_keys inputs without PyTorch installed.'''				)
																			else:
																									import torch
																			UpperCAmelCase_     : Any         =					common_inputs['''input_ids'''].shape
																			# Not using the same length for past_key_values
																			UpperCAmelCase_     : Tuple         =					seqlen + 2
																			UpperCAmelCase_     : Any         =					self.num_layers
																			UpperCAmelCase_     : Optional[Any]         =					self.num_attention_heads
																			UpperCAmelCase_     : Any         =					(
																			    batch,
																			    num_encoder_attention_heads,
																			    past_key_values_length,
																			    self._config.hidden_size // num_encoder_attention_heads,
																			)

																			UpperCAmelCase_     : Optional[Any]         =					common_inputs['''attention_mask'''].dtype
																			UpperCAmelCase_     : List[Any]         =					torch.cat(
																			    [common_inputs['''attention_mask'''], torch.ones(__magic_name__    ,       __magic_name__    ,       dtype=__magic_name__				)]    ,       dim=1				)
																			UpperCAmelCase_     : Dict         =					[
																			    (torch.zeros(__magic_name__				), torch.zeros(__magic_name__				)) for _ in range(__magic_name__				)
																			]
													return common_inputs

							def       UpperCAmelCase__		(							self							:       Optional[Any]    ,       __magic_name__							:       PreTrainedTokenizer    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       bool = False    ,       __magic_name__							:       Optional[TensorType] = None    ,       )   ->    Mapping[str, Any]:







													"""simple docstring"""
													UpperCAmelCase_     : Any         =					compute_effective_axis_dimension(
													    __magic_name__    ,       fixed_dimension=OnnxConfig.default_fixed_batch    ,       num_token_to_add=0				)

													# If dynamic axis (-1) we forward with a fixed dimension of 8 tokens to avoid optimizations made by ONNX
													UpperCAmelCase_     : Optional[Any]         =					tokenizer.num_special_tokens_to_add(__magic_name__				)
													UpperCAmelCase_     : int         =					compute_effective_axis_dimension(
													    __magic_name__    ,       fixed_dimension=OnnxConfig.default_fixed_sequence    ,       num_token_to_add=__magic_name__				)

													# Generate dummy inputs according to compute batch and sequence
													UpperCAmelCase_     : Union[str, Any]         =					[''' '''.join([tokenizer.unk_token]				) * seq_length] * batch_size
													UpperCAmelCase_     : str         =					dict(tokenizer(__magic_name__    ,       return_tensors=__magic_name__				)				)
													return common_inputs

							def       UpperCAmelCase__		(							self							:       Dict    ,       __magic_name__							:       PreTrainedTokenizer    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       int = -1    ,       __magic_name__							:       bool = False    ,       __magic_name__							:       Optional[TensorType] = None    ,       )   ->    Mapping[str, Any]:







													"""simple docstring"""
													if self.task in ["default", "seq2seq-lm"]:
																			UpperCAmelCase_     : List[str]         =					self._generate_dummy_inputs_for_default_and_seqaseq_lm(
																			    __magic_name__    ,       batch_size=__magic_name__    ,       seq_length=__magic_name__    ,       is_pair=__magic_name__    ,       framework=__magic_name__				)

													elif self.task == "causal-lm":
																			UpperCAmelCase_     : Dict         =					self._generate_dummy_inputs_for_causal_lm(
																			    __magic_name__    ,       batch_size=__magic_name__    ,       seq_length=__magic_name__    ,       is_pair=__magic_name__    ,       framework=__magic_name__				)
													else:
																			UpperCAmelCase_     : str         =					self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
																			    __magic_name__    ,       batch_size=__magic_name__    ,       seq_length=__magic_name__    ,       is_pair=__magic_name__    ,       framework=__magic_name__				)

													return common_inputs



							def       UpperCAmelCase__		(							self							:       int    ,       __magic_name__							:       Dict    ,       __magic_name__							:       Optional[Any]    ,       __magic_name__							:       str    ,       __magic_name__							:       List[str]				)   ->    str:







													"""simple docstring"""
													if self.task in ["default", "seq2seq-lm"]:
																			UpperCAmelCase_     : Tuple         =					super()._flatten_past_key_values_(__magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__				)
													else:
																			UpperCAmelCase_     : List[str]         =					super(__magic_name__    ,       self				)._flatten_past_key_values_(
																			    __magic_name__    ,       __magic_name__    ,       __magic_name__    ,       __magic_name__				)








'''simple docstring'''







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 ConvNextImageProcessor


class    __a (unittest.TestCase       ):

							def __init__(							self							:       Dict    ,       __magic_name__							:       List[str]    ,       __magic_name__							:       str=7    ,       __magic_name__							:       Optional[int]=3    ,       __magic_name__							:       Union[str, Any]=18    ,       __magic_name__							:       Dict=30    ,       __magic_name__							:       List[Any]=4_00    ,       __magic_name__							:       Dict=True    ,       __magic_name__							:       Union[str, Any]=None    ,       __magic_name__							:       Optional[Any]=0.8_7_5    ,       __magic_name__							:       List[Any]=True    ,       __magic_name__							:       Optional[int]=[0.5, 0.5, 0.5]    ,       __magic_name__							:       Optional[int]=[0.5, 0.5, 0.5]    ,       )   ->    Optional[Any]:







													"""simple docstring"""
													UpperCAmelCase_     : str         =					size if size is not None else {'''shortest_edge''': 20}
													UpperCAmelCase_     : Optional[Any]         =					parent
													UpperCAmelCase_     : Any         =					batch_size
													UpperCAmelCase_     : Optional[Any]         =					num_channels
													UpperCAmelCase_     : Optional[Any]         =					image_size
													UpperCAmelCase_     : Optional[int]         =					min_resolution
													UpperCAmelCase_     : Optional[Any]         =					max_resolution
													UpperCAmelCase_     : Optional[int]         =					do_resize
													UpperCAmelCase_     : Optional[Any]         =					size
													UpperCAmelCase_     : int         =					crop_pct
													UpperCAmelCase_     : Optional[int]         =					do_normalize
													UpperCAmelCase_     : Dict         =					image_mean
													UpperCAmelCase_     : int         =					image_std



							def       UpperCAmelCase__		(							self							:       Optional[int]				)   ->    int:







													"""simple docstring"""
													return {
													    "image_mean": self.image_mean,
													    "image_std": self.image_std,
													    "do_normalize": self.do_normalize,
													    "do_resize": self.do_resize,
													    "size": self.size,
													    "crop_pct": self.crop_pct,
													}





@require_torch
@require_vision
class    __a (lowerCamelCase    ,						unittest.TestCase       ):
							__a   :				Dict       =    ConvNextImageProcessor if is_vision_available() else None

							def       UpperCAmelCase__		(							self							:       Optional[int]				)   ->    Dict:







													"""simple docstring"""
													UpperCAmelCase_     : str         =					ConvNextImageProcessingTester(self				)

							@property
							def       UpperCAmelCase__		(							self							:       List[Any]				)   ->    Any:







													"""simple docstring"""
													return self.image_processor_tester.prepare_image_processor_dict()

							def       UpperCAmelCase__		(							self							:       List[Any]				)   ->    Tuple:







													"""simple docstring"""
													UpperCAmelCase_     : Dict         =					self.image_processing_class(**self.image_processor_dict				)
													self.assertTrue(hasattr(__magic_name__    ,       '''do_resize'''				)				)
													self.assertTrue(hasattr(__magic_name__    ,       '''size'''				)				)
													self.assertTrue(hasattr(__magic_name__    ,       '''crop_pct'''				)				)
													self.assertTrue(hasattr(__magic_name__    ,       '''do_normalize'''				)				)
													self.assertTrue(hasattr(__magic_name__    ,       '''image_mean'''				)				)
													self.assertTrue(hasattr(__magic_name__    ,       '''image_std'''				)				)

							def       UpperCAmelCase__		(							self							:       Dict				)   ->    List[Any]:







													"""simple docstring"""
													UpperCAmelCase_     : List[str]         =					self.image_processing_class.from_dict(self.image_processor_dict				)
													self.assertEqual(image_processor.size    ,       {'''shortest_edge''': 20}				)

													UpperCAmelCase_     : List[Any]         =					self.image_processing_class.from_dict(self.image_processor_dict    ,       size=42				)
													self.assertEqual(image_processor.size    ,       {'''shortest_edge''': 42}				)

							def       UpperCAmelCase__		(							self							:       str				)   ->    Optional[int]:







													"""simple docstring"""
													pass

							def       UpperCAmelCase__		(							self							:       List[str]				)   ->    int:







													"""simple docstring"""
													# Initialize image_processing
													UpperCAmelCase_     : int         =					self.image_processing_class(**self.image_processor_dict				)
													# create random PIL images
													UpperCAmelCase_     : List[Any]         =					prepare_image_inputs(self.image_processor_tester    ,       equal_resolution=__magic_name__				)
													for image in image_inputs:
																			self.assertIsInstance(__magic_name__    ,       Image.Image				)

													# Test not batched input
													UpperCAmelCase_     : int         =					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.size['''shortest_edge'''],
													        self.image_processor_tester.size['''shortest_edge'''],
													    )    ,       )

													# Test batched
													UpperCAmelCase_     : Tuple         =					image_processing(__magic_name__    ,       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.size['''shortest_edge'''],
													        self.image_processor_tester.size['''shortest_edge'''],
													    )    ,       )

							def       UpperCAmelCase__		(							self							:       str				)   ->    Optional[int]:







													"""simple docstring"""
													# Initialize image_processing
													UpperCAmelCase_     : Optional[Any]         =					self.image_processing_class(**self.image_processor_dict				)
													# create random numpy tensors
													UpperCAmelCase_     : Tuple         =					prepare_image_inputs(self.image_processor_tester    ,       equal_resolution=__magic_name__    ,       numpify=__magic_name__				)
													for image in image_inputs:
																			self.assertIsInstance(__magic_name__    ,       np.ndarray				)

													# Test not batched input
													UpperCAmelCase_     : int         =					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.size['''shortest_edge'''],
													        self.image_processor_tester.size['''shortest_edge'''],
													    )    ,       )

													# Test batched
													UpperCAmelCase_     : Union[str, Any]         =					image_processing(__magic_name__    ,       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.size['''shortest_edge'''],
													        self.image_processor_tester.size['''shortest_edge'''],
													    )    ,       )



							def       UpperCAmelCase__		(							self							:       str				)   ->    int:







													"""simple docstring"""
													# Initialize image_processing
													UpperCAmelCase_     : Union[str, Any]         =					self.image_processing_class(**self.image_processor_dict				)
													# create random PyTorch tensors
													UpperCAmelCase_     : List[Any]         =					prepare_image_inputs(self.image_processor_tester    ,       equal_resolution=__magic_name__    ,       torchify=__magic_name__				)
													for image in image_inputs:
																			self.assertIsInstance(__magic_name__    ,       torch.Tensor				)

													# Test not batched input
													UpperCAmelCase_     : List[Any]         =					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.size['''shortest_edge'''],
													        self.image_processor_tester.size['''shortest_edge'''],
													    )    ,       )

													# Test batched
													UpperCAmelCase_     : str         =					image_processing(__magic_name__    ,       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.size['''shortest_edge'''],
													        self.image_processor_tester.size['''shortest_edge'''],
													    )    ,       )





