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


UpperCAmelCase      		=					logging.get_logger(__name__)

UpperCAmelCase      		=					{
    '''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  __lowerCAmelCase	(							a_    ):



 '''simple docstring'''
 _lowerCamelCase    :						Any					     =			'bigbird_pegasus'
 _lowerCamelCase    :						int					     =			['past_key_values']
 _lowerCamelCase    :						int					     =			{
     'num_attention_heads': 'encoder_attention_heads',
     'hidden_size': 'd_model',
     'attention_probs_dropout_prob': 'attention_dropout',
 }

 def __init__(      self							:		Optional[int]							,      lowerCamelCase							:		int=9_6_1_0_3							,      lowerCamelCase							:		int=4_0_9_6							,      lowerCamelCase							:		List[str]=1_6							,      lowerCamelCase							:		Any=4_0_9_6							,      lowerCamelCase							:		List[Any]=1_6							,      lowerCamelCase							:		str=1_6							,      lowerCamelCase							:		Dict=4_0_9_6							,      lowerCamelCase							:		str=1_6							,      lowerCamelCase							:		Union[str, Any]=0.0							,      lowerCamelCase							:		Optional[Any]=0.0							,      lowerCamelCase							:		int=True							,      lowerCamelCase							:		Any=True							,      lowerCamelCase							:		Dict="gelu_new"							,      lowerCamelCase							:		List[str]=1_0_2_4							,      lowerCamelCase							:		Any=0.1							,      lowerCamelCase							:		Union[str, Any]=0.0							,      lowerCamelCase							:		Any=0.0							,      lowerCamelCase							:		List[Any]=0.0_2							,      lowerCamelCase							:		Union[str, Any]=2							,      lowerCamelCase							:		Any=0.0							,      lowerCamelCase							:		Union[str, Any]=True							,      lowerCamelCase							:		Any=0							,      lowerCamelCase							:		str=2							,      lowerCamelCase							:		Any=1							,      lowerCamelCase							:		Tuple="block_sparse"							,      lowerCamelCase							:		Optional[int]=6_4							,      lowerCamelCase							:		List[str]=3							,      lowerCamelCase							:		str=False							,      **lowerCamelCase							:		Dict							,      )			->				Any:
        _UpperCamelCase  :							List[Any]	    =	vocab_size
        _UpperCamelCase  :							int	    =	max_position_embeddings
        _UpperCamelCase  :							int	    =	d_model
        _UpperCamelCase  :							List[str]	    =	encoder_ffn_dim
        _UpperCamelCase  :							Union[str, Any]	    =	encoder_layers
        _UpperCamelCase  :							Tuple	    =	encoder_attention_heads
        _UpperCamelCase  :							Optional[int]	    =	decoder_ffn_dim
        _UpperCamelCase  :							List[Any]	    =	decoder_layers
        _UpperCamelCase  :							Optional[Any]	    =	decoder_attention_heads
        _UpperCamelCase  :							Union[str, Any]	    =	dropout
        _UpperCamelCase  :							Union[str, Any]	    =	attention_dropout
        _UpperCamelCase  :							Optional[int]	    =	activation_dropout
        _UpperCamelCase  :							List[str]	    =	activation_function
        _UpperCamelCase  :							Optional[int]	    =	init_std
        _UpperCamelCase  :							Dict	    =	encoder_layerdrop
        _UpperCamelCase  :							str	    =	decoder_layerdrop
        _UpperCamelCase  :							List[str]	    =	classifier_dropout
        _UpperCamelCase  :							int	    =	use_cache
        _UpperCamelCase  :							str	    =	encoder_layers
        _UpperCamelCase  :							Optional[Any]	    =	scale_embedding  # scale factor will be sqrt(d_model) if True

        # extra config
        _UpperCamelCase  :							Optional[Any]	    =	attention_type
        _UpperCamelCase  :							Any	    =	block_size
        _UpperCamelCase  :							List[str]	    =	num_random_blocks
        _UpperCamelCase  :							str	    =	use_bias

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







class  __lowerCAmelCase	(							a_    ):



 '''simple docstring'''

 @property
 def        __snake_case       (      self							:		List[str]	)			->				Mapping[str, Mapping[int, str]]:
        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  :							Any	    =	{0: 'batch'}
                      _UpperCamelCase  :							Dict	    =	{0: 'batch', 1: 'past_decoder_sequence + sequence'}
               else:
                      _UpperCamelCase  :							List[Any]	    =	{0: 'batch', 1: 'decoder_sequence'}
                      _UpperCamelCase  :							List[Any]	    =	{0: 'batch', 1: 'decoder_sequence'}

               if self.use_past:
                      self.fill_with_past_key_values_(lowerCamelCase							,      direction='inputs'	)
        elif self.task == "causal-lm":
               # TODO: figure this case out.
               _UpperCamelCase  :							str	    =	OrderedDict(
                   [
                       ('input_ids', {0: 'batch', 1: 'encoder_sequence'}),
                       ('attention_mask', {0: 'batch', 1: 'encoder_sequence'}),
                   ]	)
               if self.use_past:
                      _UpperCamelCase    ,   _UpperCamelCase  :							List[Any]	    =	self.num_layers
                      for i in range(lowerCamelCase	):
                             _UpperCamelCase  :							str	    =	{0: 'batch', 2: 'past_sequence + sequence'}
                             _UpperCamelCase  :							Union[str, Any]	    =	{0: 'batch', 2: 'past_sequence + sequence'}
        else:
               _UpperCamelCase  :							str	    =	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        __snake_case       (      self							:		List[Any]	)			->				Mapping[str, Mapping[int, str]]:
        if self.task in ["default", "seq2seq-lm"]:
               _UpperCamelCase  :							List[Any]	    =	super().outputs
        else:
               _UpperCamelCase  :							Tuple	    =	super(lowerCamelCase							,      self	).outputs
               if self.use_past:
                      _UpperCamelCase    ,   _UpperCamelCase  :							List[Any]	    =	self.num_layers
                      for i in range(lowerCamelCase	):
                             _UpperCamelCase  :							List[str]	    =	{0: 'batch', 2: 'past_sequence + sequence'}
                             _UpperCamelCase  :							Any	    =	{0: 'batch', 2: 'past_sequence + sequence'}
        return common_outputs

 def        __snake_case       (      self							:		int							,      lowerCamelCase							:		PreTrainedTokenizer							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		bool = False							,      lowerCamelCase							:		Optional[TensorType] = None							,      )			->				Mapping[str, Any]:
        _UpperCamelCase  :							Tuple	    =	self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
            lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)

        # Generate decoder inputs
        _UpperCamelCase  :							Any	    =	seq_length if not self.use_past else 1
        _UpperCamelCase  :							Optional[int]	    =	self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
            lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        _UpperCamelCase  :							Optional[Any]	    =	{f"decoder_{name}": tensor for name, tensor in decoder_inputs.items()}
        _UpperCamelCase  :							Union[str, Any]	    =	dict(**lowerCamelCase							,      **lowerCamelCase	)

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

               _UpperCamelCase  :							int	    =	torch.cat(
                   [common_inputs['decoder_attention_mask'], torch.ones(lowerCamelCase							,      lowerCamelCase	)]							,      dim=1	)

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

               for _ in range(lowerCamelCase	):
                      common_inputs["past_key_values"].append(
                          (
                              torch.zeros(lowerCamelCase	),
                              torch.zeros(lowerCamelCase	),
                              torch.zeros(lowerCamelCase	),
                              torch.zeros(lowerCamelCase	),
                          )	)
               # TODO: test this.
               _UpperCamelCase  :							List[str]	    =	encoder_shape if remaining_side_name == 'encoder' else decoder_shape
               for _ in range(lowerCamelCase							,      lowerCamelCase	):
                      common_inputs["past_key_values"].append((torch.zeros(lowerCamelCase	), torch.zeros(lowerCamelCase	))	)
        return common_inputs

 def        __snake_case       (      self							:		Optional[Any]							,      lowerCamelCase							:		PreTrainedTokenizer							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		bool = False							,      lowerCamelCase							:		Optional[TensorType] = None							,      )			->				Mapping[str, Any]:
        _UpperCamelCase  :							Optional[Any]	    =	self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
            lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)

        if self.use_past:
               if not is_torch_available():
                      raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'	)
               else:
                      import torch
               _UpperCamelCase    ,   _UpperCamelCase  :							str	    =	common_inputs['input_ids'].shape
               # Not using the same length for past_key_values
               _UpperCamelCase  :							Any	    =	seqlen + 2
               _UpperCamelCase    ,   _UpperCamelCase  :							Optional[int]	    =	self.num_layers
               _UpperCamelCase    ,   _UpperCamelCase  :							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(lowerCamelCase							,      lowerCamelCase							,      dtype=lowerCamelCase	)]							,      dim=1	)
               _UpperCamelCase  :							Union[str, Any]	    =	[
                   (torch.zeros(lowerCamelCase	), torch.zeros(lowerCamelCase	)) for _ in range(lowerCamelCase	)
               ]
        return common_inputs

 def        __snake_case       (      self							:		Any							,      lowerCamelCase							:		PreTrainedTokenizer							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		bool = False							,      lowerCamelCase							:		Optional[TensorType] = None							,      )			->				Mapping[str, Any]:
        # Copied from OnnxConfig.generate_dummy_inputs
        # Did not use super(OnnxConfigWithPast, self).generate_dummy_inputs for code clarity.
        # If dynamic axis (-1) we forward with a fixed dimension of 2 samples to avoid optimizations made by ONNX
        _UpperCamelCase  :							List[Any]	    =	compute_effective_axis_dimension(
            lowerCamelCase							,      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  :							List[Any]	    =	tokenizer.num_special_tokens_to_add(lowerCamelCase	)
        _UpperCamelCase  :							List[str]	    =	compute_effective_axis_dimension(
            lowerCamelCase							,      fixed_dimension=OnnxConfig.default_fixed_sequence							,      num_token_to_add=lowerCamelCase	)

        # Generate dummy inputs according to compute batch and sequence
        _UpperCamelCase  :							int	    =	[' '.join([tokenizer.unk_token]	) * seq_length] * batch_size
        _UpperCamelCase  :							int	    =	dict(tokenizer(lowerCamelCase							,      return_tensors=lowerCamelCase	)	)
        return common_inputs

 def        __snake_case       (      self							:		Any							,      lowerCamelCase							:		PreTrainedTokenizer							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		int = -1							,      lowerCamelCase							:		bool = False							,      lowerCamelCase							:		Optional[TensorType] = None							,      )			->				Mapping[str, Any]:
        if self.task in ["default", "seq2seq-lm"]:
               _UpperCamelCase  :							Optional[Any]	    =	self._generate_dummy_inputs_for_default_and_seqaseq_lm(
                   lowerCamelCase							,      batch_size=lowerCamelCase							,      seq_length=lowerCamelCase							,      is_pair=lowerCamelCase							,      framework=lowerCamelCase	)

        elif self.task == "causal-lm":
               _UpperCamelCase  :							Optional[int]	    =	self._generate_dummy_inputs_for_causal_lm(
                   lowerCamelCase							,      batch_size=lowerCamelCase							,      seq_length=lowerCamelCase							,      is_pair=lowerCamelCase							,      framework=lowerCamelCase	)
        else:
               _UpperCamelCase  :							List[Any]	    =	self._generate_dummy_inputs_for_sequence_classification_and_question_answering(
                   lowerCamelCase							,      batch_size=lowerCamelCase							,      seq_length=lowerCamelCase							,      is_pair=lowerCamelCase							,      framework=lowerCamelCase	)

        return common_inputs

 def        __snake_case       (      self							:		Optional[int]							,      lowerCamelCase							:		int							,      lowerCamelCase							:		Optional[int]							,      lowerCamelCase							:		Optional[int]							,      lowerCamelCase							:		str	)			->				Any:
        if self.task in ["default", "seq2seq-lm"]:
               _UpperCamelCase  :							str	    =	super()._flatten_past_key_values_(lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)
        else:
               _UpperCamelCase  :							Optional[int]	    =	super(lowerCamelCase							,      self	)._flatten_past_key_values_(
                   lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase							,      lowerCamelCase	)











"""simple docstring"""
import unittest

import numpy as np
import torch
from torch import nn
from transformers import (
    CLIPImageProcessor,
    CLIPTextConfig,
    CLIPTextModelWithProjection,
    CLIPTokenizer,
    CLIPVisionConfig,
    CLIPVisionModelWithProjection,
)

from diffusers import KandinskyPriorPipeline, PriorTransformer, UnCLIPScheduler
from diffusers.utils import torch_device
from diffusers.utils.testing_utils import enable_full_determinism, skip_mps

from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()



class 						a_ (      snake_case_    ,		unittest.TestCase					):







      '''simple docstring'''

      lowerCamelCase__			:							Optional[Any]					=      KandinskyPriorPipeline
      lowerCamelCase__			:							Any					=      ['prompt']
      lowerCamelCase__			:							Any					=      ['prompt', 'negative_prompt']
      lowerCamelCase__			:							str					=      [
          'num_images_per_prompt',
          'generator',
          'num_inference_steps',
          'latents',
          'negative_prompt',
          'guidance_scale',
          'output_type',
          'return_dict',
      ]
      lowerCamelCase__			:							Dict					=      False




      @property
      def      a__				(self   ):

       '''simple docstring'''



       return 3_2




      @property
      def      a__				(self   ):

       '''simple docstring'''



       return 3_2




      @property
      def      a__				(self   ):

       '''simple docstring'''



       return self.time_input_dim




      @property
      def      a__				(self   ):

       '''simple docstring'''



       return self.time_input_dim * 4




      @property
      def      a__				(self   ):

       '''simple docstring'''



       return 1_0_0




      @property
      def      a__				(self   ):

       '''simple docstring'''



       lowerCamelCase__	:     Any								=		CLIPTokenizer.from_pretrained('hf-internal-testing/tiny-random-clip'   )
       return tokenizer




      @property
      def      a__				(self   ):

       '''simple docstring'''



       torch.manual_seed(0   )
       lowerCamelCase__	:     int								=		CLIPTextConfig(
           bos_token_id=0,	eos_token_id=2,	hidden_size=self.text_embedder_hidden_size,	projection_dim=self.text_embedder_hidden_size,	intermediate_size=3_7,	layer_norm_eps=1e-05,	num_attention_heads=4,	num_hidden_layers=5,	pad_token_id=1,	vocab_size=1_0_0_0,	)
       return CLIPTextModelWithProjection(lowerCamelCase_   )




      @property
      def      a__				(self   ):

       '''simple docstring'''



       torch.manual_seed(0   )

       lowerCamelCase__	:     Optional[int]								=		{
           'num_attention_heads': 2,
           'attention_head_dim': 1_2,
           'embedding_dim': self.text_embedder_hidden_size,
           'num_layers': 1,
       }

       lowerCamelCase__	:     Optional[int]								=		PriorTransformer(**lowerCamelCase_   )
       # clip_std and clip_mean is initialized to be 0 so PriorTransformer.post_process_latents will always return 0 - set clip_std to be 1 so it won't return 0
       lowerCamelCase__	:     Dict								=		nn.Parameter(torch.ones(model.clip_std.shape   )   )
       return model




      @property
      def      a__				(self   ):

       '''simple docstring'''



       torch.manual_seed(0   )
       lowerCamelCase__	:     List[str]								=		CLIPVisionConfig(
           hidden_size=self.text_embedder_hidden_size,	image_size=2_2_4,	projection_dim=self.text_embedder_hidden_size,	intermediate_size=3_7,	num_attention_heads=4,	num_channels=3,	num_hidden_layers=5,	patch_size=1_4,	)

       lowerCamelCase__	:     int								=		CLIPVisionModelWithProjection(lowerCamelCase_   )
       return model




      @property
      def      a__				(self   ):

       '''simple docstring'''



       lowerCamelCase__	:     Union[str, Any]								=		CLIPImageProcessor(
           crop_size=2_2_4,	do_center_crop=lowerCamelCase_,	do_normalize=lowerCamelCase_,	do_resize=lowerCamelCase_,	image_mean=[0.48_145_466, 0.4_578_275, 0.40_821_073],	image_std=[0.26_862_954, 0.26_130_258, 0.27_577_711],	resample=3,	size=2_2_4,	)

       return image_processor




      def      a__				(self   ):

       '''simple docstring'''



       lowerCamelCase__	:     str								=		self.dummy_prior
       lowerCamelCase__	:     Optional[Any]								=		self.dummy_image_encoder
       lowerCamelCase__	:     Optional[Any]								=		self.dummy_text_encoder
       lowerCamelCase__	:     Union[str, Any]								=		self.dummy_tokenizer
       lowerCamelCase__	:     List[Any]								=		self.dummy_image_processor

       lowerCamelCase__	:     List[Any]								=		UnCLIPScheduler(
           variance_type='fixed_small_log',	prediction_type='sample',	num_train_timesteps=1_0_0_0,	clip_sample=lowerCamelCase_,	clip_sample_range=10.0,	)

       lowerCamelCase__	:     Union[str, Any]								=		{
           'prior': prior,
           'image_encoder': image_encoder,
           'text_encoder': text_encoder,
           'tokenizer': tokenizer,
           'scheduler': scheduler,
           'image_processor': image_processor,
       }

       return components




      def      a__				(self,	lowerCamelCase_,	lowerCamelCase_=0   ):

       '''simple docstring'''



       if str(lowerCamelCase_   ).startswith('mps'   ):
        lowerCamelCase__	:     List[Any]								=		torch.manual_seed(lowerCamelCase_   )
       else:
        lowerCamelCase__	:     Optional[int]								=		torch.Generator(device=lowerCamelCase_   ).manual_seed(lowerCamelCase_   )
       lowerCamelCase__	:     List[Any]								=		{
           'prompt': 'horse',
           'generator': generator,
           'guidance_scale': 4.0,
           'num_inference_steps': 2,
           'output_type': 'np',
       }
       return inputs




      def      a__				(self   ):

       '''simple docstring'''



       lowerCamelCase__	:     List[str]								=		'cpu'

       lowerCamelCase__	:     str								=		self.get_dummy_components()

       lowerCamelCase__	:     Any								=		self.pipeline_class(**lowerCamelCase_   )
       lowerCamelCase__	:     Dict								=		pipe.to(lowerCamelCase_   )

       pipe.set_progress_bar_config(disable=lowerCamelCase_   )

       lowerCamelCase__	:     Tuple								=		pipe(**self.get_dummy_inputs(lowerCamelCase_   )   )
       lowerCamelCase__	:     Dict								=		output.image_embeds

       lowerCamelCase__	:     Optional[Any]								=		pipe(
           **self.get_dummy_inputs(lowerCamelCase_   ),	return_dict=lowerCamelCase_,	)[0]

       lowerCamelCase__	:     Dict								=		image[0, -1_0:]
       lowerCamelCase__	:     Tuple								=		image_from_tuple[0, -1_0:]

       assert image.shape == (1, 3_2)

       lowerCamelCase__	:     Dict								=		np.array(
           [-0.0_532, 1.7_120, 0.3_656, -1.0_852, -0.8_946, -1.1_756, 0.4_348, 0.2_482, 0.5_146, -0.1_156]   )

       assert np.abs(image_slice.flatten() - expected_slice   ).max() < 1e-2
       assert np.abs(image_from_tuple_slice.flatten() - expected_slice   ).max() < 1e-2




      @skip_mps
      def      a__				(self   ):

       '''simple docstring'''



       lowerCamelCase__	:     Optional[int]								=		torch_device == 'cpu'
       lowerCamelCase__	:     Any								=		True
       lowerCamelCase__	:     List[Any]								=		False

       self._test_inference_batch_single_identical(
           test_max_difference=lowerCamelCase_,	relax_max_difference=lowerCamelCase_,	test_mean_pixel_difference=lowerCamelCase_,	)





      @skip_mps
      def      a__				(self   ):

       '''simple docstring'''



       lowerCamelCase__	:     str								=		torch_device == 'cpu'
       lowerCamelCase__	:     int								=		False

       self._test_attention_slicing_forward_pass(
           test_max_difference=lowerCamelCase_,	test_mean_pixel_difference=lowerCamelCase_,	)

