


import shutil
import tempfile
import unittest

import numpy as np
import pytest

from transformers.testing_utils import require_vision
from transformers.utils import is_vision_available


if is_vision_available():
 from PIL import Image

 from transformers import (
     AutoProcessor,
     BertTokenizerFast,
     BlipImageProcessor,
     GPTaTokenizer,
     InstructBlipProcessor,
     PreTrainedTokenizerFast,
 )






@require_vision
class _lowerCamelCase(		unittest.TestCase     ):
       def     UpperCamelCase  (      self) ->     Tuple:




           """simple docstring"""

           _lowercase :							Union[str, Any]   	=	tempfile.mkdtemp()

           _lowercase :							Optional[int]   	=	BlipImageProcessor()
           _lowercase :							str   	=	GPTaTokenizer.from_pretrained('hf-internal-testing/tiny-random-GPT2Model')
           _lowercase :							int   	=	BertTokenizerFast.from_pretrained('hf-internal-testing/tiny-random-bert')

           _lowercase :							Tuple   	=	InstructBlipProcessor(lowerCamelCase,   lowerCamelCase,   lowerCamelCase)

           processor.save_pretrained(self.tmpdirname)
       def     UpperCamelCase  (      self,   **lowerCamelCase) ->     Any:




           """simple docstring"""

           return AutoProcessor.from_pretrained(self.tmpdirname,   **lowerCamelCase).tokenizer
       def     UpperCamelCase  (      self,   **lowerCamelCase) ->     Tuple:




           """simple docstring"""

           return AutoProcessor.from_pretrained(self.tmpdirname,   **lowerCamelCase).image_processor
       def     UpperCamelCase  (      self,   **lowerCamelCase) ->     Optional[Any]:




           """simple docstring"""

           return AutoProcessor.from_pretrained(self.tmpdirname,   **lowerCamelCase).qformer_tokenizer
       def     UpperCamelCase  (      self) ->     str:




           """simple docstring"""

           shutil.rmtree(self.tmpdirname)
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           _lowercase :							List[str]   	=	[np.random.randint(2_55,   size=(3, 30, 4_00),   dtype=np.uinta)]

           _lowercase :							Any   	=	[Image.fromarray(np.moveaxis(lowerCamelCase,   0,   -1)) for x in image_inputs]

           return image_inputs
       def     UpperCamelCase  (      self) ->     Tuple:




           """simple docstring"""

           _lowercase :							Tuple   	=	InstructBlipProcessor(
               tokenizer=self.get_tokenizer(),   image_processor=self.get_image_processor(),   qformer_tokenizer=self.get_qformer_tokenizer(),   )
           processor.save_pretrained(self.tmpdirname)

           _lowercase :							List[Any]   	=	self.get_tokenizer(bos_token='(BOS)',   eos_token='(EOS)')
           _lowercase :							Optional[int]   	=	self.get_image_processor(do_normalize=lowerCamelCase,   padding_value=1.0)

           _lowercase :							Dict   	=	InstructBlipProcessor.from_pretrained(
               self.tmpdirname,   bos_token='(BOS)',   eos_token='(EOS)',   do_normalize=lowerCamelCase,   padding_value=1.0)

           self.assertEqual(processor.tokenizer.get_vocab(),   tokenizer_add_kwargs.get_vocab())
           self.assertIsInstance(processor.tokenizer,   lowerCamelCase)

           self.assertEqual(processor.image_processor.to_json_string(),   image_processor_add_kwargs.to_json_string())
           self.assertIsInstance(processor.image_processor,   lowerCamelCase)
           self.assertIsInstance(processor.qformer_tokenizer,   lowerCamelCase)
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           _lowercase :							Union[str, Any]   	=	self.get_image_processor()
           _lowercase :							Optional[int]   	=	self.get_tokenizer()
           _lowercase :							List[str]   	=	self.get_qformer_tokenizer()

           _lowercase :							Union[str, Any]   	=	InstructBlipProcessor(
               tokenizer=lowerCamelCase,   image_processor=lowerCamelCase,   qformer_tokenizer=lowerCamelCase)

           _lowercase :							str   	=	self.prepare_image_inputs()

           _lowercase :							Dict   	=	image_processor(lowerCamelCase,   return_tensors='np')
           _lowercase :							Tuple   	=	processor(images=lowerCamelCase,   return_tensors='np')

           for key in input_feat_extract.keys():
               self.assertAlmostEqual(input_feat_extract[key].sum(),   input_processor[key].sum(),   delta=1E-2)
       def     UpperCamelCase  (      self) ->     Optional[Any]:




           """simple docstring"""

           _lowercase :							Dict   	=	self.get_image_processor()
           _lowercase :							List[str]   	=	self.get_tokenizer()
           _lowercase :							List[Any]   	=	self.get_qformer_tokenizer()

           _lowercase :							Optional[Any]   	=	InstructBlipProcessor(
               tokenizer=lowerCamelCase,   image_processor=lowerCamelCase,   qformer_tokenizer=lowerCamelCase)

           _lowercase :							List[str]   	=	'lower newer'

           _lowercase :							int   	=	processor(text=lowerCamelCase)

           _lowercase :							Tuple   	=	tokenizer(lowerCamelCase,   return_token_type_ids=lowerCamelCase)
           _lowercase :							Any   	=	qformer_tokenizer(lowerCamelCase,   return_token_type_ids=lowerCamelCase)

           for key in encoded_tokens.keys():
               self.assertListEqual(encoded_tokens[key],   encoded_processor[key])

           for key in encoded_tokens_qformer.keys():
               self.assertListEqual(encoded_tokens_qformer[key],   encoded_processor['qformer_' + key])
       def     UpperCamelCase  (      self) ->     Union[str, Any]:




           """simple docstring"""

           _lowercase :							Tuple   	=	self.get_image_processor()
           _lowercase :							int   	=	self.get_tokenizer()
           _lowercase :							int   	=	self.get_qformer_tokenizer()

           _lowercase :							Tuple   	=	InstructBlipProcessor(
               tokenizer=lowerCamelCase,   image_processor=lowerCamelCase,   qformer_tokenizer=lowerCamelCase)

           _lowercase :							str   	=	'lower newer'
           _lowercase :							int   	=	self.prepare_image_inputs()

           _lowercase :							Union[str, Any]   	=	processor(text=lowerCamelCase,   images=lowerCamelCase)

           self.assertListEqual(
               list(inputs.keys()),   ['input_ids', 'attention_mask', 'qformer_input_ids', 'qformer_attention_mask', 'pixel_values'],   )

           # test if it raises when no input is passed
           with pytest.raises(lowerCamelCase):
               processor()
       def     UpperCamelCase  (      self) ->     Dict:




           """simple docstring"""

           _lowercase :							Optional[int]   	=	self.get_image_processor()
           _lowercase :							Tuple   	=	self.get_tokenizer()
           _lowercase :							Dict   	=	self.get_qformer_tokenizer()

           _lowercase :							List[str]   	=	InstructBlipProcessor(
               tokenizer=lowerCamelCase,   image_processor=lowerCamelCase,   qformer_tokenizer=lowerCamelCase)

           _lowercase :							Tuple   	=	[[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

           _lowercase :							Dict   	=	processor.batch_decode(lowerCamelCase)
           _lowercase :							Tuple   	=	tokenizer.batch_decode(lowerCamelCase)

           self.assertListEqual(lowerCamelCase,   lowerCamelCase)




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




           """simple docstring"""

           _lowercase :							Tuple   	=	self.get_image_processor()
           _lowercase :							str   	=	self.get_tokenizer()
           _lowercase :							Dict   	=	self.get_qformer_tokenizer()

           _lowercase :							Union[str, Any]   	=	InstructBlipProcessor(
               tokenizer=lowerCamelCase,   image_processor=lowerCamelCase,   qformer_tokenizer=lowerCamelCase)

           _lowercase :							Union[str, Any]   	=	'lower newer'
           _lowercase :							Optional[Any]   	=	self.prepare_image_inputs()

           _lowercase :							Tuple   	=	processor(text=lowerCamelCase,   images=lowerCamelCase)

           self.assertListEqual(
               list(inputs.keys()),   ['input_ids', 'attention_mask', 'qformer_input_ids', 'qformer_attention_mask', 'pixel_values'],   )






import unittest

from diffusers.models.unet_ad_blocks import *  # noqa F403
from diffusers.utils import torch_device

from .test_unet_blocks_common import UNetBlockTesterMixin






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			str									=    DownBlockaD  # noqa F405
       lowercase_				:			List[str]									=    """down"""
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           _lowercase :							str   	=	[-0.0_2_3_2, -0.9_8_6_9, 0.8_0_5_4, -0.0_6_3_7, -0.1_6_8_8, -1.4_2_6_4, 0.4_4_7_0, -1.3_3_9_4, 0.0_9_0_4]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Optional[Any]									=    ResnetDownsampleBlockaD  # noqa F405
       lowercase_				:			Optional[Any]									=    """down"""
       def     UpperCamelCase  (      self) ->     Any:




           """simple docstring"""

           _lowercase :							Optional[Any]   	=	[0.0_7_1_0, 0.2_4_1_0, -0.7_3_2_0, -1.0_7_5_7, -1.1_3_4_3, 0.3_5_4_0, -0.0_1_3_3, -0.2_5_7_6, 0.0_9_4_8]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Any									=    AttnDownBlockaD  # noqa F405
       lowercase_				:			Dict									=    """down"""
       def     UpperCamelCase  (      self) ->     Optional[int]:




           """simple docstring"""

           _lowercase :							Optional[int]   	=	[0.0_6_3_6, 0.8_9_6_4, -0.6_2_3_4, -1.0_1_3_1, 0.0_8_4_4, 0.4_9_3_5, 0.3_4_3_7, 0.0_9_1_1, -0.2_9_5_7]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			str									=    CrossAttnDownBlockaD  # noqa F405
       lowercase_				:			Optional[int]									=    """down"""
       def     UpperCamelCase  (      self) ->     Dict:




           """simple docstring"""

           _lowercase	,       _lowercase :							int   	=	super().prepare_init_args_and_inputs_for_common()
           _lowercase :							int   	=	32
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     str:




           """simple docstring"""

           _lowercase :							List[str]   	=	[0.2_2_3_8, -0.7_3_9_6, -0.2_2_5_5, -0.3_8_2_9, 0.1_9_2_5, 1.1_6_6_5, 0.0_6_0_3, -0.7_2_9_5, 0.1_9_8_3]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Dict									=    SimpleCrossAttnDownBlockaD  # noqa F405
       lowercase_				:			Optional[Any]									=    """down"""
       @property
       def     UpperCamelCase  (      self) ->     Optional[int]:




           """simple docstring"""

           return super().get_dummy_input(include_encoder_hidden_states=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     List[Any]:




           """simple docstring"""

           _lowercase	,       _lowercase :							Dict   	=	super().prepare_init_args_and_inputs_for_common()
           _lowercase :							Optional[Any]   	=	32
           return init_dict, inputs_dict




       @unittest.skipIf(torch_device == 'mps',   'MPS result is not consistent')
       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           _lowercase :							Tuple   	=	[0.7_9_2_1, -0.0_9_9_2, -0.1_9_6_2, -0.7_6_9_5, -0.4_2_4_2, 0.7_8_0_4, 0.4_7_3_7, 0.2_7_6_5, 0.3_3_3_8]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			str									=    SkipDownBlockaD  # noqa F405
       lowercase_				:			Union[str, Any]									=    """down"""
       @property
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           return super().get_dummy_input(include_skip_sample=lowerCamelCase)




       def     UpperCamelCase  (      self) ->     Tuple:




           """simple docstring"""

           _lowercase :							int   	=	[-0.0_8_4_5, -0.2_0_8_7, -0.2_4_6_5, 0.0_9_7_1, 0.1_9_0_0, -0.0_4_8_4, 0.2_6_6_4, 0.4_1_7_9, 0.5_0_6_9]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			str									=    AttnSkipDownBlockaD  # noqa F405
       lowercase_				:			Optional[Any]									=    """down"""
       @property
       def     UpperCamelCase  (      self) ->     Tuple:




           """simple docstring"""

           return super().get_dummy_input(include_skip_sample=lowerCamelCase)




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




           """simple docstring"""

           _lowercase :							Optional[int]   	=	[0.5_5_3_9, 0.1_6_0_9, 0.4_9_2_4, 0.0_5_3_7, -0.1_9_9_5, 0.4_0_5_0, 0.0_9_7_9, -0.2_7_2_1, -0.0_6_4_2]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			str									=    DownEncoderBlockaD  # noqa F405
       lowercase_				:			Optional[Any]									=    """down"""
       @property
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           return super().get_dummy_input(include_temb=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           _lowercase :							Dict   	=	{
               'in_channels': 32,
               'out_channels': 32,
           }
           _lowercase :							int   	=	self.dummy_input
           return init_dict, inputs_dict




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




           """simple docstring"""

           _lowercase :							List[str]   	=	[1.1_1_0_2, 0.5_3_0_2, 0.4_8_7_2, -0.0_0_2_3, -0.8_0_4_2, 0.0_4_8_3, -0.3_4_8_9, -0.5_6_3_2, 0.7_6_2_6]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			int									=    AttnDownEncoderBlockaD  # noqa F405
       lowercase_				:			Tuple									=    """down"""
       @property
       def     UpperCamelCase  (      self) ->     Tuple:




           """simple docstring"""

           return super().get_dummy_input(include_temb=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     str:




           """simple docstring"""

           _lowercase :							Any   	=	{
               'in_channels': 32,
               'out_channels': 32,
           }
           _lowercase :							Optional[int]   	=	self.dummy_input
           return init_dict, inputs_dict




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




           """simple docstring"""

           _lowercase :							Union[str, Any]   	=	[0.8_9_6_6, -0.1_4_8_6, 0.8_5_6_8, 0.8_1_4_1, -0.9_0_4_6, -0.1_3_4_2, -0.0_9_7_2, -0.7_4_1_7, 0.1_5_3_8]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			int									=    UNetMidBlockaD  # noqa F405
       lowercase_				:			Optional[int]									=    """mid"""
       def     UpperCamelCase  (      self) ->     Optional[Any]:




           """simple docstring"""

           _lowercase :							int   	=	{
               'in_channels': 32,
               'temb_channels': 1_28,
           }
           _lowercase :							Optional[Any]   	=	self.dummy_input
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     Dict:




           """simple docstring"""

           _lowercase :							Dict   	=	[-0.1_0_6_2, 1.7_2_4_8, 0.3_4_9_4, 1.4_5_6_9, -0.0_9_1_0, -1.2_4_2_1, -0.9_9_8_4, 0.6_7_3_6, 1.0_0_2_8]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Dict									=    UNetMidBlockaDCrossAttn  # noqa F405
       lowercase_				:			Dict									=    """mid"""
       def     UpperCamelCase  (      self) ->     Optional[int]:




           """simple docstring"""

           _lowercase	,       _lowercase :							Union[str, Any]   	=	super().prepare_init_args_and_inputs_for_common()
           _lowercase :							Any   	=	32
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     str:




           """simple docstring"""

           _lowercase :							Dict   	=	[0.0_1_8_7, 2.4_2_2_0, 0.4_4_8_4, 1.1_2_0_3, -0.6_1_2_1, -1.5_1_2_2, -0.8_2_7_0, 0.7_8_5_1, 1.8_3_3_5]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			List[Any]									=    UNetMidBlockaDSimpleCrossAttn  # noqa F405
       lowercase_				:			Any									=    """mid"""
       @property
       def     UpperCamelCase  (      self) ->     Union[str, Any]:




           """simple docstring"""

           return super().get_dummy_input(include_encoder_hidden_states=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     Dict:




           """simple docstring"""

           _lowercase	,       _lowercase :							str   	=	super().prepare_init_args_and_inputs_for_common()
           _lowercase :							List[str]   	=	32
           return init_dict, inputs_dict




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




           """simple docstring"""

           _lowercase :							int   	=	[0.7_1_4_3, 1.9_9_7_4, 0.5_4_4_8, 1.3_9_7_7, 0.1_2_8_2, -1.1_2_3_7, -1.4_2_3_8, 0.5_5_3_0, 0.8_8_8_0]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			List[Any]									=    UpBlockaD  # noqa F405
       lowercase_				:			List[str]									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     List[Any]:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase)




       def     UpperCamelCase  (      self) ->     Dict:




           """simple docstring"""

           _lowercase :							Any   	=	[-0.2_0_4_1, -0.4_1_6_5, -0.3_0_2_2, 0.0_0_4_1, -0.6_6_2_8, -0.7_0_5_3, 0.1_9_2_8, -0.0_3_2_5, 0.0_5_2_3]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			List[str]									=    ResnetUpsampleBlockaD  # noqa F405
       lowercase_				:			Optional[int]									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase)




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




           """simple docstring"""

           _lowercase :							List[Any]   	=	[0.2_2_8_7, 0.3_5_4_9, -0.1_3_4_6, 0.4_7_9_7, -0.1_7_1_5, -0.9_6_4_9, 0.7_3_0_5, -0.5_8_6_4, -0.6_2_4_4]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Dict									=    CrossAttnUpBlockaD  # noqa F405
       lowercase_				:			List[str]									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     Union[str, Any]:




           """simple docstring"""

           _lowercase	,       _lowercase :							Union[str, Any]   	=	super().prepare_init_args_and_inputs_for_common()
           _lowercase :							Tuple   	=	32
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     str:




           """simple docstring"""

           _lowercase :							Dict   	=	[-0.1_4_0_3, -0.3_5_1_5, -0.0_4_2_0, -0.1_4_2_5, 0.3_1_6_7, 0.5_0_9_4, -0.2_1_8_1, 0.5_9_3_1, 0.5_5_8_2]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Optional[int]									=    SimpleCrossAttnUpBlockaD  # noqa F405
       lowercase_				:			List[Any]									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     Any:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase,   include_encoder_hidden_states=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           _lowercase	,       _lowercase :							int   	=	super().prepare_init_args_and_inputs_for_common()
           _lowercase :							Dict   	=	32
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     Dict:




           """simple docstring"""

           _lowercase :							List[str]   	=	[0.2_6_4_5, 0.1_4_8_0, 0.0_9_0_9, 0.8_0_4_4, -0.9_7_5_8, -0.9_0_8_3, 0.0_9_9_4, -1.1_4_5_3, -0.7_4_0_2]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			List[str]									=    AttnUpBlockaD  # noqa F405
       lowercase_				:			Optional[int]									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     Optional[int]:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase)




       @unittest.skipIf(torch_device == 'mps',   'MPS result is not consistent')
       def     UpperCamelCase  (      self) ->     Optional[int]:




           """simple docstring"""

           _lowercase :							Union[str, Any]   	=	[0.0_9_7_9, 0.1_3_2_6, 0.0_0_2_1, 0.0_6_5_9, 0.2_2_4_9, 0.0_0_5_9, 0.1_1_3_2, 0.5_9_5_2, 0.1_0_3_3]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			List[str]									=    SkipUpBlockaD  # noqa F405
       lowercase_				:			Optional[Any]									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     List[str]:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase)




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




           """simple docstring"""

           _lowercase :							Optional[Any]   	=	[-0.0_8_9_3, -0.1_2_3_4, -0.1_5_0_6, -0.0_3_3_2, 0.0_1_2_3, -0.0_2_1_1, 0.0_5_6_6, 0.0_1_4_3, 0.0_3_6_2]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			int									=    AttnSkipUpBlockaD  # noqa F405
       lowercase_				:			Any									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           return super().get_dummy_input(include_res_hidden_states_tuple=lowerCamelCase)




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




           """simple docstring"""

           _lowercase :							Tuple   	=	[0.0_3_6_1, 0.0_6_1_7, 0.2_7_8_7, -0.0_3_5_0, 0.0_3_4_2, 0.3_4_2_1, -0.0_8_4_3, 0.0_9_1_3, 0.3_0_1_5]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			List[str]									=    UpDecoderBlockaD  # noqa F405
       lowercase_				:			int									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     List[Any]:




           """simple docstring"""

           return super().get_dummy_input(include_temb=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     Optional[int]:




           """simple docstring"""

           _lowercase :							Optional[Any]   	=	{'in_channels': 32, 'out_channels': 32}

           _lowercase :							Optional[Any]   	=	self.dummy_input
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           _lowercase :							List[Any]   	=	[0.4_4_0_4, 0.1_9_9_8, -0.9_8_8_6, -0.3_3_2_0, -0.3_1_2_8, -0.7_0_3_4, -0.6_9_5_5, -0.2_3_3_8, -0.3_1_3_7]
           super().test_output(lowerCamelCase)






class _lowerCamelCase(		_a,				unittest.TestCase     ):
       lowercase_				:			Any									=    AttnUpDecoderBlockaD  # noqa F405
       lowercase_				:			str									=    """up"""
       @property
       def     UpperCamelCase  (      self) ->     int:




           """simple docstring"""

           return super().get_dummy_input(include_temb=lowerCamelCase)
       def     UpperCamelCase  (      self) ->     Any:




           """simple docstring"""

           _lowercase :							Optional[Any]   	=	{'in_channels': 32, 'out_channels': 32}

           _lowercase :							List[Any]   	=	self.dummy_input
           return init_dict, inputs_dict




       def     UpperCamelCase  (      self) ->     str:




           """simple docstring"""

           _lowercase :							Optional[int]   	=	[0.6_7_3_8, 0.4_4_9_1, 0.1_0_5_5, 1.0_7_1_0, 0.7_3_1_6, 0.3_3_3_9, 0.3_3_5_2, 0.1_0_2_3, 0.3_5_6_8]
           super().test_output(lowerCamelCase)


