





import json
import os
import unittest

from transformers.models.roc_bert.tokenization_roc_bert import (
    VOCAB_FILES_NAMES,
    RoCBertBasicTokenizer,
    RoCBertTokenizer,
    RoCBertWordpieceTokenizer,
    _is_control,
    _is_punctuation,
    _is_whitespace,
)
from transformers.testing_utils import require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin, filter_non_english



@require_tokenizers
class 					__snake_case	(  lowercase_			,     unittest.TestCase    ):


    '''simple docstring'''







    lowerCamelCase__    :		Optional[Any]				=	RoCBertTokenizer
    lowerCamelCase__    :		Dict				=	None
    lowerCamelCase__    :		Tuple				=	False
    lowerCamelCase__    :		Optional[Any]				=	True
    lowerCamelCase__    :		Any				=	filter_non_english



    def  lowercase_					(       self     ):





        '''simple docstring'''

        super().setUp()

        SCREAMING_SNAKE_CASE__											=			["""[UNK]""", """[CLS]""", """[SEP]""", """[PAD]""", """[MASK]""", """你""", """好""", """是""", """谁""", """a""", """b""", """c""", """d"""]
        SCREAMING_SNAKE_CASE__											=			{}
        SCREAMING_SNAKE_CASE__											=			{}
        for i, value in enumerate(a__     ):
            SCREAMING_SNAKE_CASE__											=			i
            SCREAMING_SNAKE_CASE__											=			i
        SCREAMING_SNAKE_CASE__											=			os.path.join(self.tmpdirname   ,				VOCAB_FILES_NAMES['''vocab_file''']     )
        SCREAMING_SNAKE_CASE__											=			os.path.join(self.tmpdirname   ,				VOCAB_FILES_NAMES['''word_shape_file''']     )
        SCREAMING_SNAKE_CASE__											=			os.path.join(self.tmpdirname   ,				VOCAB_FILES_NAMES['''word_pronunciation_file''']     )
        with open(self.vocab_file   ,				'''w'''   ,				encoding='''utf-8'''     ) as vocab_writer:
            vocab_writer.write(''''''.join([x + '''\n''' for x in vocab_tokens]     )     )
        with open(self.word_shape_file   ,				'''w'''   ,				encoding='''utf-8'''     ) as word_shape_writer:
            json.dump(a__   ,				a__   ,				ensure_ascii=a__     )
        with open(self.word_pronunciation_file   ,				'''w'''   ,				encoding='''utf-8'''     ) as word_pronunciation_writer:
            json.dump(a__   ,				a__   ,				ensure_ascii=a__     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.tokenizer_class(self.vocab_file   ,				self.word_shape_file   ,				self.word_pronunciation_file     )

        SCREAMING_SNAKE_CASE__											=			tokenizer.tokenize('''你好[SEP]你是谁'''     )
        self.assertListEqual(a__   ,				['''你''', '''好''', '''[SEP]''', '''你''', '''是''', '''谁''']     )
        self.assertListEqual(tokenizer.convert_tokens_to_ids(a__     )   ,				[5, 6, 2, 5, 7, 8]     )
        self.assertListEqual(tokenizer.convert_tokens_to_shape_ids(a__     )   ,				[5, 6, 2, 5, 7, 8]     )
        self.assertListEqual(tokenizer.convert_tokens_to_pronunciation_ids(a__     )   ,				[5, 6, 2, 5, 7, 8]     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer()

        self.assertListEqual(tokenizer.tokenize('''ah\u535A\u63A8zz'''     )   ,				['''ah''', '''\u535A''', '''\u63A8''', '''zz''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHeLLo!how  \n Are yoU?  '''     )   ,				['''hello''', '''!''', '''how''', '''are''', '''you''', '''?''']     )
        self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''     )   ,				['''hello''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__   ,				strip_accents=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''     )   ,				['''hällo''', '''!''', '''how''', '''are''', '''you''', '''?''']     )
        self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''     )   ,				['''h\u00E9llo''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__   ,				strip_accents=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''     )   ,				['''hallo''', '''!''', '''how''', '''are''', '''you''', '''?''']     )
        self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''     )   ,				['''hello''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''     )   ,				['''hallo''', '''!''', '''how''', '''are''', '''you''', '''?''']     )
        self.assertListEqual(tokenizer.tokenize('''H\u00E9llo'''     )   ,				['''hello''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHeLLo!how  \n Are yoU?  '''     )   ,				['''HeLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__   ,				strip_accents=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''     )   ,				['''HäLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__   ,				strip_accents=a__     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHäLLo!how  \n Are yoU?  '''     )   ,				['''HaLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			RoCBertBasicTokenizer(do_lower_case=a__   ,				never_split=['''[UNK]''']     )

        self.assertListEqual(
            tokenizer.tokenize(''' \tHeLLo!how  \n Are yoU? [UNK]'''     )   ,				['''HeLLo''', '''!''', '''how''', '''Are''', '''yoU''', '''?''', '''[UNK]''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			["""[UNK]""", """[CLS]""", """[SEP]""", """want""", """##want""", """##ed""", """wa""", """un""", """runn""", """##ing"""]

        SCREAMING_SNAKE_CASE__											=			{}
        for i, token in enumerate(a__     ):
            SCREAMING_SNAKE_CASE__											=			i
        SCREAMING_SNAKE_CASE__											=			RoCBertWordpieceTokenizer(vocab=a__   ,				unk_token='''[UNK]'''     )

        self.assertListEqual(tokenizer.tokenize(''''''     )   ,				[]     )

        self.assertListEqual(tokenizer.tokenize('''unwanted running'''     )   ,				['''un''', '''##want''', '''##ed''', '''runn''', '''##ing''']     )

        self.assertListEqual(tokenizer.tokenize('''unwantedX running'''     )   ,				['''[UNK]''', '''runn''', '''##ing''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        self.assertTrue(_is_whitespace(''' '''     )     )
        self.assertTrue(_is_whitespace('''\t'''     )     )
        self.assertTrue(_is_whitespace('''\r'''     )     )
        self.assertTrue(_is_whitespace('''\n'''     )     )
        self.assertTrue(_is_whitespace('''\u00A0'''     )     )

        self.assertFalse(_is_whitespace('''A'''     )     )
        self.assertFalse(_is_whitespace('''-'''     )     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        self.assertTrue(_is_control('''\u0005'''     )     )

        self.assertFalse(_is_control('''A'''     )     )
        self.assertFalse(_is_control(''' '''     )     )
        self.assertFalse(_is_control('''\t'''     )     )
        self.assertFalse(_is_control('''\r'''     )     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        self.assertTrue(_is_punctuation('''-'''     )     )
        self.assertTrue(_is_punctuation('''$'''     )     )
        self.assertTrue(_is_punctuation('''`'''     )     )
        self.assertTrue(_is_punctuation('''.'''     )     )

        self.assertFalse(_is_punctuation('''A'''     )     )
        self.assertFalse(_is_punctuation(''' '''     )     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.get_tokenizer()

        # Example taken from the issue https://github.com/huggingface/tokenizers/issues/340
        self.assertListEqual([tokenizer.tokenize(a__     ) for t in ['''Test''', '''\xad''', '''test''']]   ,				[['''[UNK]'''], [], ['''[UNK]''']]     )

        if self.test_rust_tokenizer:
            SCREAMING_SNAKE_CASE__											=			self.get_rust_tokenizer()
            self.assertListEqual(
                [rust_tokenizer.tokenize(a__     ) for t in ['''Test''', '''\xad''', '''test''']]   ,				[['''[UNK]'''], [], ['''[UNK]''']]     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
            with self.subTest(f'''{tokenizer.__class__.__name__} ({pretrained_name})'''     ):
                SCREAMING_SNAKE_CASE__											=			self.rust_tokenizer_class.from_pretrained(a__   ,				**a__     )

                SCREAMING_SNAKE_CASE__											=			f'''A, naïve {tokenizer_r.mask_token} AllenNLP sentence.'''
                SCREAMING_SNAKE_CASE__											=			tokenizer_r.encode_plus(
                    a__   ,				return_attention_mask=a__   ,				return_token_type_ids=a__   ,				return_offsets_mapping=a__   ,				add_special_tokens=a__   ,				)

                SCREAMING_SNAKE_CASE__											=			tokenizer_r.do_lower_case if hasattr(a__   ,				'''do_lower_case'''     ) else False
                SCREAMING_SNAKE_CASE__											=			(
                    [
                        ((0, 0), tokenizer_r.cls_token),
                        ((0, 1), """A"""),
                        ((1, 2), ""","""),
                        ((3, 5), """na"""),
                        ((5, 6), """##ï"""),
                        ((6, 8), """##ve"""),
                        ((9, 15), tokenizer_r.mask_token),
                        ((16, 21), """Allen"""),
                        ((21, 23), """##NL"""),
                        ((23, 24), """##P"""),
                        ((25, 33), """sentence"""),
                        ((33, 34), """."""),
                        ((0, 0), tokenizer_r.sep_token),
                    ]
                    if not do_lower_case
                    else [
                        ((0, 0), tokenizer_r.cls_token),
                        ((0, 1), """a"""),
                        ((1, 2), ""","""),
                        ((3, 8), """naive"""),
                        ((9, 15), tokenizer_r.mask_token),
                        ((16, 21), """allen"""),
                        ((21, 23), """##nl"""),
                        ((23, 24), """##p"""),
                        ((25, 33), """sentence"""),
                        ((33, 34), """."""),
                        ((0, 0), tokenizer_r.sep_token),
                    ]
                )

                self.assertEqual(
                    [e[1] for e in expected_results]   ,				tokenizer_r.convert_ids_to_tokens(tokens['''input_ids''']     )     )
                self.assertEqual([e[0] for e in expected_results]   ,				tokens['''offset_mapping''']     )



    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			["""的""", """人""", """有"""]
        SCREAMING_SNAKE_CASE__											=			"""""".join(a__     )
        for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
            with self.subTest(f'''{tokenizer.__class__.__name__} ({pretrained_name})'''     ):
                SCREAMING_SNAKE_CASE__											=			True
                SCREAMING_SNAKE_CASE__											=			self.tokenizer_class.from_pretrained(a__   ,				**a__     )
                SCREAMING_SNAKE_CASE__											=			self.rust_tokenizer_class.from_pretrained(a__   ,				**a__     )

                SCREAMING_SNAKE_CASE__											=			tokenizer_p.encode(a__   ,				add_special_tokens=a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer_r.encode(a__   ,				add_special_tokens=a__     )

                SCREAMING_SNAKE_CASE__											=			tokenizer_r.convert_ids_to_tokens(a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer_p.convert_ids_to_tokens(a__     )

                # it is expected that each Chinese character is not preceded by "##"
                self.assertListEqual(a__   ,				a__     )
                self.assertListEqual(a__   ,				a__     )

                SCREAMING_SNAKE_CASE__											=			False
                SCREAMING_SNAKE_CASE__											=			self.rust_tokenizer_class.from_pretrained(a__   ,				**a__     )
                SCREAMING_SNAKE_CASE__											=			self.tokenizer_class.from_pretrained(a__   ,				**a__     )

                SCREAMING_SNAKE_CASE__											=			tokenizer_r.encode(a__   ,				add_special_tokens=a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer_p.encode(a__   ,				add_special_tokens=a__     )

                SCREAMING_SNAKE_CASE__											=			tokenizer_r.convert_ids_to_tokens(a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer_p.convert_ids_to_tokens(a__     )

                # it is expected that only the first Chinese character is not preceded by "##".
                SCREAMING_SNAKE_CASE__											=			[
                    f'''##{token}''' if idx != 0 else token for idx, token in enumerate(a__     )
                ]
                self.assertListEqual(a__   ,				a__     )
                self.assertListEqual(a__   ,				a__     )



    @slow
    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.tokenizer_class(self.vocab_file   ,				self.word_shape_file   ,				self.word_pronunciation_file     )

        SCREAMING_SNAKE_CASE__											=			tokenizer.encode('''你好'''   ,				add_special_tokens=a__     )
        SCREAMING_SNAKE_CASE__											=			tokenizer.encode('''你是谁'''   ,				add_special_tokens=a__     )

        SCREAMING_SNAKE_CASE__											=			tokenizer.build_inputs_with_special_tokens(a__     )
        SCREAMING_SNAKE_CASE__											=			tokenizer.build_inputs_with_special_tokens(a__   ,				a__     )

        assert encoded_sentence == [1] + text + [2]
        assert encoded_pair == [1] + text + [2] + text_a + [2]




    def  lowercase_					(       self     ):





        '''simple docstring'''

        SCREAMING_SNAKE_CASE__											=			self.get_tokenizers(do_lower_case=a__     )
        for tokenizer in tokenizers:
            with self.subTest(f'''{tokenizer.__class__.__name__}'''     ):
                SCREAMING_SNAKE_CASE__											=			"""你好，你是谁"""
                SCREAMING_SNAKE_CASE__											=			tokenizer.tokenize(a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer.convert_tokens_to_ids(a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer.convert_tokens_to_shape_ids(a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer.convert_tokens_to_pronunciation_ids(a__     )
                SCREAMING_SNAKE_CASE__											=			tokenizer.prepare_for_model(
                    a__   ,				a__   ,				a__   ,				add_special_tokens=a__     )

                SCREAMING_SNAKE_CASE__											=			tokenizer.encode_plus(a__   ,				add_special_tokens=a__     )

                self.assertEqual(a__   ,				a__     )








import unittest

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

from diffusers import KandinskyVaaPriorPipeline, 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       snake_case__ (				lowercase_						,     unittest.TestCase):

       '''simple docstring'''
       lowerCamelCase				:					Tuple								=			KandinskyVaaPriorPipeline
       lowerCamelCase				:					Optional[Any]								=			["prompt"]
       lowerCamelCase				:					Any								=			["prompt", "negative_prompt"]
       lowerCamelCase				:					Tuple								=			[
           "num_images_per_prompt",
           "generator",
           "num_inference_steps",
           "latents",
           "negative_prompt",
           "guidance_scale",
           "output_type",
           "return_dict",
       ]
       lowerCamelCase				:					Any								=			False



       @property
       def        __lowercase    (				self     )			->   Union[str, Any]:






            '''simple docstring'''





            return 32



       @property
       def        __lowercase    (				self     )			->   Any:






            '''simple docstring'''





            return 32



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






            '''simple docstring'''





            return self.time_input_dim



       @property
       def        __lowercase    (				self     )			->   Optional[Any]:






            '''simple docstring'''





            return self.time_input_dim * 4



       @property
       def        __lowercase    (				self     )			->   Optional[Any]:






            '''simple docstring'''





            return 1_00



       @property
       def        __lowercase    (				self     )			->   Optional[Any]:






            '''simple docstring'''





            __snake_case      :Tuple 							=    CLIPTokenizer.from_pretrained("""hf-internal-testing/tiny-random-clip"""     )
            return tokenizer



       @property
       def        __lowercase    (				self     )			->   str:






            '''simple docstring'''





            torch.manual_seed(0     )
            __snake_case      :Dict 							=    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=37      ,    layer_norm_eps=1e-05      ,    num_attention_heads=4      ,    num_hidden_layers=5      ,    pad_token_id=1      ,    vocab_size=10_00      ,    )
            return CLIPTextModelWithProjection(a__     )



       @property
       def        __lowercase    (				self     )			->   str:






            '''simple docstring'''





            torch.manual_seed(0     )

            __snake_case      :List[Any] 							=    {
                """num_attention_heads""": 2,
                """attention_head_dim""": 12,
                """embedding_dim""": self.text_embedder_hidden_size,
                """num_layers""": 1,
            }

            __snake_case      :Union[str, Any] 							=    PriorTransformer(**a__     )
            # 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
            __snake_case      :int 							=    nn.Parameter(torch.ones(model.clip_std.shape     )     )
            return model



       @property
       def        __lowercase    (				self     )			->   List[str]:






            '''simple docstring'''





            torch.manual_seed(0     )
            __snake_case      :List[Any] 							=    CLIPVisionConfig(
                hidden_size=self.text_embedder_hidden_size      ,    image_size=2_24      ,    projection_dim=self.text_embedder_hidden_size      ,    intermediate_size=37      ,    num_attention_heads=4      ,    num_channels=3      ,    num_hidden_layers=5      ,    patch_size=14      ,    )

            __snake_case      :Tuple 							=    CLIPVisionModelWithProjection(a__     )
            return model



       @property
       def        __lowercase    (				self     )			->   Optional[Any]:






            '''simple docstring'''





            __snake_case      :Optional[int] 							=    CLIPImageProcessor(
                crop_size=2_24      ,    do_center_crop=a__      ,    do_normalize=a__      ,    do_resize=a__      ,    image_mean=[0.48_14_54_66, 0.4_57_82_75, 0.40_82_10_73]      ,    image_std=[0.26_86_29_54, 0.26_13_02_58, 0.27_57_77_11]      ,    resample=3      ,    size=2_24      ,    )

            return image_processor



       def        __lowercase    (				self     )			->   Optional[Any]:






            '''simple docstring'''





            __snake_case      :Optional[Any] 							=    self.dummy_prior
            __snake_case      :Tuple 							=    self.dummy_image_encoder
            __snake_case      :List[Any] 							=    self.dummy_text_encoder
            __snake_case      :List[str] 							=    self.dummy_tokenizer
            __snake_case      :int 							=    self.dummy_image_processor

            __snake_case      :Union[str, Any] 							=    UnCLIPScheduler(
                variance_type="""fixed_small_log"""      ,    prediction_type="""sample"""      ,    num_train_timesteps=10_00      ,    clip_sample=a__      ,    clip_sample_range=10.0      ,    )

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

            return components



       def        __lowercase    (				self      ,    a__      ,    a__=0     )			->   Optional[Any]:






            '''simple docstring'''





            if str(a__     ).startswith("""mps"""     ):
                 __snake_case      :Any 							=    torch.manual_seed(a__     )
            else:
                 __snake_case      :Any 							=    torch.Generator(device=a__     ).manual_seed(a__     )
            __snake_case      :Union[str, Any] 							=    {
                """prompt""": """horse""",
                """generator""": generator,
                """guidance_scale""": 4.0,
                """num_inference_steps""": 2,
                """output_type""": """np""",
            }
            return inputs



       def        __lowercase    (				self     )			->   List[str]:






            '''simple docstring'''





            __snake_case      :str 							=    """cpu"""

            __snake_case      :Optional[Any] 							=    self.get_dummy_components()

            __snake_case      :List[Any] 							=    self.pipeline_class(**a__     )
            __snake_case      :Union[str, Any] 							=    pipe.to(a__     )

            pipe.set_progress_bar_config(disable=a__     )

            __snake_case      :List[Any] 							=    pipe(**self.get_dummy_inputs(a__     )     )
            __snake_case      :Any 							=    output.image_embeds

            __snake_case      :Any 							=    pipe(
                **self.get_dummy_inputs(a__     )      ,    return_dict=a__      ,    )[0]

            __snake_case      :Any 							=    image[0, -10:]
            __snake_case      :Any 							=    image_from_tuple[0, -10:]

            assert image.shape == (1, 32)

            __snake_case      :List[str] 							=    np.array(
                [-0.05_32, 1.71_20, 0.36_56, -1.08_52, -0.89_46, -1.17_56, 0.43_48, 0.24_82, 0.51_46, -0.11_56]     )

            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        __lowercase    (				self     )			->   str:






            '''simple docstring'''





            __snake_case      :List[Any] 							=    torch_device == """cpu"""
            __snake_case      :List[str] 							=    True
            __snake_case      :Optional[Any] 							=    False

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



       @skip_mps
       def        __lowercase    (				self     )			->   List[Any]:






            '''simple docstring'''





            __snake_case      :Any 							=    torch_device == """cpu"""
            __snake_case      :str 							=    False

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


