


'''simple docstring'''



import multiprocessing
import os
from typing import BinaryIO, Optional, Union

import fsspec

from .. import Dataset, Features, NamedSplit, config
from ..formatting import query_table
from ..packaged_modules.json.json import Json
from ..utils import logging
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader





class   UpperCAmelCase_    (_UpperCAmelCase    ):





    """simple docstring"""






    def __init__(				self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_ = None     ,	SCREAMING_SNAKE_CASE_ = None     ,	SCREAMING_SNAKE_CASE_ = None     ,	SCREAMING_SNAKE_CASE_ = False     ,	SCREAMING_SNAKE_CASE_ = False     ,	SCREAMING_SNAKE_CASE_ = None     ,	SCREAMING_SNAKE_CASE_ = None     ,	**SCREAMING_SNAKE_CASE_     ,	)							->	Dict:
         super().__init__(
             SCREAMING_SNAKE_CASE_     ,	split=SCREAMING_SNAKE_CASE_     ,	features=SCREAMING_SNAKE_CASE_     ,	cache_dir=SCREAMING_SNAKE_CASE_     ,	keep_in_memory=SCREAMING_SNAKE_CASE_     ,	streaming=SCREAMING_SNAKE_CASE_     ,	num_proc=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_     ,	)
         __lowerCamelCase  :      Any														=						field
         __lowerCamelCase  :      Tuple														=						path_or_paths if isinstance(SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_      ) else {self.split: path_or_paths}
         __lowerCamelCase  :      int														=						Json(
             cache_dir=SCREAMING_SNAKE_CASE_     ,	data_files=SCREAMING_SNAKE_CASE_     ,	features=SCREAMING_SNAKE_CASE_     ,	field=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_     ,	)







    def  lowercase_							(				self      )							->	List[str]:
         # Build iterable dataset
         if self.streaming:
              __lowerCamelCase  :      str														=						self.builder.as_streaming_dataset(split=self.split      )
         # Build regular (map-style) dataset
         else:
              __lowerCamelCase  :      List[Any]														=						None
              __lowerCamelCase  :      Optional[Any]														=						None
              __lowerCamelCase  :      Union[str, Any]														=						None
              __lowerCamelCase  :      Dict														=						None

              self.builder.download_and_prepare(
                  download_config=SCREAMING_SNAKE_CASE_     ,	download_mode=SCREAMING_SNAKE_CASE_     ,	verification_mode=SCREAMING_SNAKE_CASE_     ,	base_path=SCREAMING_SNAKE_CASE_     ,	num_proc=self.num_proc     ,	)
              __lowerCamelCase  :      List[str]														=						self.builder.as_dataset(
                  split=self.split     ,	verification_mode=SCREAMING_SNAKE_CASE_     ,	in_memory=self.keep_in_memory      )
         return dataset







class   UpperCAmelCase_    :





    """simple docstring"""






    def __init__(				self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_ = None     ,	SCREAMING_SNAKE_CASE_ = None     ,	**SCREAMING_SNAKE_CASE_     ,	)							->	int:
         if num_proc is not None and num_proc <= 0:
              raise ValueError(f'num_proc {num_proc} must be an integer > 0.'      )

         __lowerCamelCase  :      Tuple														=						dataset
         __lowerCamelCase  :      Dict														=						path_or_buf
         __lowerCamelCase  :      int														=						batch_size if batch_size else config.DEFAULT_MAX_BATCH_SIZE
         __lowerCamelCase  :      str														=						num_proc
         __lowerCamelCase  :      Union[str, Any]														=						'utf-8'
         __lowerCamelCase  :      str														=						to_json_kwargs







    def  lowercase_							(				self      )							->	int:
         __lowerCamelCase  :      Optional[Any]														=						self.to_json_kwargs.pop('path_or_buf'     ,	SCREAMING_SNAKE_CASE_      )
         __lowerCamelCase  :      Tuple														=						self.to_json_kwargs.pop('orient'     ,	'records'      )
         __lowerCamelCase  :      List[Any]														=						self.to_json_kwargs.pop('lines'     ,	True if orient == 'records' else False      )
         __lowerCamelCase  :      List[str]														=						self.to_json_kwargs.pop('index'     ,	False if orient in ['split', 'table'] else True      )
         __lowerCamelCase  :      Tuple														=						self.to_json_kwargs.pop('compression'     ,	SCREAMING_SNAKE_CASE_      )

         if compression not in [None, "infer", "gzip", "bz2", "xz"]:
              raise NotImplementedError(f'`datasets` currently does not support {compression} compression'      )

         if isinstance(self.path_or_buf     ,	(str, bytes, os.PathLike)      ):
              with fsspec.open(self.path_or_buf     ,	'wb'     ,	compression=SCREAMING_SNAKE_CASE_      ) as buffer:
                   __lowerCamelCase  :      List[Any]														=						self._write(file_obj=SCREAMING_SNAKE_CASE_     ,	orient=SCREAMING_SNAKE_CASE_     ,	lines=SCREAMING_SNAKE_CASE_     ,	index=SCREAMING_SNAKE_CASE_     ,	**self.to_json_kwargs      )
         else:
              if compression:
                   raise NotImplementedError(
                       f'The compression parameter is not supported when writing to a buffer, but compression={compression}'
                       ' was passed. Please provide a local path instead.'      )
              __lowerCamelCase  :      Dict														=						self._write(
                  file_obj=self.path_or_buf     ,	orient=SCREAMING_SNAKE_CASE_     ,	lines=SCREAMING_SNAKE_CASE_     ,	index=SCREAMING_SNAKE_CASE_     ,	**self.to_json_kwargs      )
         return written







    def  lowercase_							(				self     ,	SCREAMING_SNAKE_CASE_      )							->	List[str]:
         __lowerCamelCase							,			__lowerCamelCase							,			__lowerCamelCase							,			__lowerCamelCase							,			__lowerCamelCase  :      str														=						args

         __lowerCamelCase  :      List[str]														=						query_table(
             table=self.dataset.data     ,	key=slice(SCREAMING_SNAKE_CASE_     ,	offset + self.batch_size      )     ,	indices=self.dataset._indices     ,	)
         __lowerCamelCase  :      Tuple														=						batch.to_pandas().to_json(
             path_or_buf=SCREAMING_SNAKE_CASE_     ,	orient=SCREAMING_SNAKE_CASE_     ,	lines=SCREAMING_SNAKE_CASE_     ,	index=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_      )
         if not json_str.endswith('\n'      ):
              json_str += "\n"
         return json_str.encode(self.encoding      )







    def  lowercase_							(				self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_     ,	)							->	int:
         __lowerCamelCase  :      Any														=						0

         if self.num_proc is None or self.num_proc == 1:
              for offset in logging.tqdm(
                  range(0     ,	len(self.dataset      )     ,	self.batch_size      )     ,	unit='ba'     ,	disable=not logging.is_progress_bar_enabled()     ,	desc='Creating json from Arrow format'     ,	):
                   __lowerCamelCase  :      Optional[int]														=						self._batch_json((offset, orient, lines, index, to_json_kwargs)      )
                   written += file_obj.write(SCREAMING_SNAKE_CASE_      )
         else:
              __lowerCamelCase							,			__lowerCamelCase  :      Optional[Any]														=						len(self.dataset      ), self.batch_size
              with multiprocessing.Pool(self.num_proc      ) as pool:
                   for json_str in logging.tqdm(
                       pool.imap(
                           self._batch_json     ,	[(offset, orient, lines, index, to_json_kwargs) for offset in range(0     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_      )]     ,	)     ,	total=(num_rows // batch_size) + 1 if num_rows % batch_size else num_rows // batch_size     ,	unit='ba'     ,	disable=not logging.is_progress_bar_enabled()     ,	desc='Creating json from Arrow format'     ,	):
                        written += file_obj.write(SCREAMING_SNAKE_CASE_      )

         return written










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       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							DownBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



  def        lowerCAmelCase__	(  self							:							int	) ->			Tuple:




     """simple docstring"""
     snake_case_            =       [-0.0_232, -0.9_869, 0.8_054, -0.0_637, -0.1_688, -1.4_264, 0.4_470, -1.3_394, 0.0_904]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							ResnetDownsampleBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



  def        lowerCAmelCase__	(  self							:							Any	) ->			Union[str, Any]:




     """simple docstring"""
     snake_case_            =       [0.0_710, 0.2_410, -0.7_320, -1.0_757, -1.1_343, 0.3_540, -0.0_133, -0.2_576, 0.0_948]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							AttnDownBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			Tuple:




     """simple docstring"""
     snake_case_            =       [0.0_636, 0.8_964, -0.6_234, -1.0_131, 0.0_844, 0.4_935, 0.3_437, 0.0_911, -0.2_957]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							CrossAttnDownBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



  def        lowerCAmelCase__	(  self							:							str	) ->			Tuple:




     """simple docstring"""
     snake_case_     ,     snake_case_            =       super().prepare_init_args_and_inputs_for_common()
     snake_case_            =       3_2
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							List[Any]	) ->			str:




     """simple docstring"""
     snake_case_            =       [0.2_238, -0.7_396, -0.2_255, -0.3_829, 0.1_925, 1.1_665, 0.0_603, -0.7_295, 0.1_983]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							SimpleCrossAttnDownBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



  @property
  def        lowerCAmelCase__	(  self							:							Dict	) ->			Any:




     """simple docstring"""
     return super().get_dummy_input(include_encoder_hidden_states=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							List[Any]	) ->			Optional[int]:




     """simple docstring"""
     snake_case_     ,     snake_case_            =       super().prepare_init_args_and_inputs_for_common()
     snake_case_            =       3_2
     return init_dict, inputs_dict



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




     """simple docstring"""
     snake_case_            =       [0.7_921, -0.0_992, -0.1_962, -0.7_695, -0.4_242, 0.7_804, 0.4_737, 0.2_765, 0.3_338]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							SkipDownBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



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




     """simple docstring"""
     return super().get_dummy_input(include_skip_sample=_lowerCAmelCase	)



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




     """simple docstring"""
     snake_case_            =       [-0.0_845, -0.2_087, -0.2_465, 0.0_971, 0.1_900, -0.0_484, 0.2_664, 0.4_179, 0.5_069]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							AttnSkipDownBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



  @property
  def        lowerCAmelCase__	(  self							:							Any	) ->			Dict:




     """simple docstring"""
     return super().get_dummy_input(include_skip_sample=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			Any:




     """simple docstring"""
     snake_case_            =       [0.5_539, 0.1_609, 0.4_924, 0.0_537, -0.1_995, 0.4_050, 0.0_979, -0.2_721, -0.0_642]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							DownEncoderBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



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




     """simple docstring"""
     return super().get_dummy_input(include_temb=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			Dict:




     """simple docstring"""
     snake_case_            =       {
         "in_channels": 3_2,
         "out_channels": 3_2,
     }
     snake_case_            =       self.dummy_input
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							Optional[int]	) ->			List[Any]:




     """simple docstring"""
     snake_case_            =       [1.1_102, 0.5_302, 0.4_872, -0.0_023, -0.8_042, 0.0_483, -0.3_489, -0.5_632, 0.7_626]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							AttnDownEncoderBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'down'



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




     """simple docstring"""
     return super().get_dummy_input(include_temb=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							int	) ->			Dict:




     """simple docstring"""
     snake_case_            =       {
         "in_channels": 3_2,
         "out_channels": 3_2,
     }
     snake_case_            =       self.dummy_input
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							List[str]	) ->			Any:




     """simple docstring"""
     snake_case_            =       [0.8_966, -0.1_486, 0.8_568, 0.8_141, -0.9_046, -0.1_342, -0.0_972, -0.7_417, 0.1_538]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							UNetMidBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'mid'



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




     """simple docstring"""
     snake_case_            =       {
         "in_channels": 3_2,
         "temb_channels": 1_2_8,
     }
     snake_case_            =       self.dummy_input
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			int:




     """simple docstring"""
     snake_case_            =       [-0.1_062, 1.7_248, 0.3_494, 1.4_569, -0.0_910, -1.2_421, -0.9_984, 0.6_736, 1.0_028]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							UNetMidBlockaDCrossAttn  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'mid'



  def        lowerCAmelCase__	(  self							:							int	) ->			List[Any]:




     """simple docstring"""
     snake_case_     ,     snake_case_            =       super().prepare_init_args_and_inputs_for_common()
     snake_case_            =       3_2
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							Tuple	) ->			Any:




     """simple docstring"""
     snake_case_            =       [0.0_187, 2.4_220, 0.4_484, 1.1_203, -0.6_121, -1.5_122, -0.8_270, 0.7_851, 1.8_335]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							UNetMidBlockaDSimpleCrossAttn  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'mid'



  @property
  def        lowerCAmelCase__	(  self							:							Tuple	) ->			Any:




     """simple docstring"""
     return super().get_dummy_input(include_encoder_hidden_states=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							Optional[Any]	) ->			Union[str, Any]:




     """simple docstring"""
     snake_case_     ,     snake_case_            =       super().prepare_init_args_and_inputs_for_common()
     snake_case_            =       3_2
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			Optional[Any]:




     """simple docstring"""
     snake_case_            =       [0.7_143, 1.9_974, 0.5_448, 1.3_977, 0.1_282, -1.1_237, -1.4_238, 0.5_530, 0.8_880]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							UpBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



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




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							str	) ->			Any:




     """simple docstring"""
     snake_case_            =       [-0.2_041, -0.4_165, -0.3_022, 0.0_041, -0.6_628, -0.7_053, 0.1_928, -0.0_325, 0.0_523]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							ResnetUpsampleBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



  @property
  def        lowerCAmelCase__	(  self							:							str	) ->			int:




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase	)



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




     """simple docstring"""
     snake_case_            =       [0.2_287, 0.3_549, -0.1_346, 0.4_797, -0.1_715, -0.9_649, 0.7_305, -0.5_864, -0.6_244]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							CrossAttnUpBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



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




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							List[str]	) ->			Optional[Any]:




     """simple docstring"""
     snake_case_     ,     snake_case_            =       super().prepare_init_args_and_inputs_for_common()
     snake_case_            =       3_2
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			List[Any]:




     """simple docstring"""
     snake_case_            =       [-0.1_403, -0.3_515, -0.0_420, -0.1_425, 0.3_167, 0.5_094, -0.2_181, 0.5_931, 0.5_582]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							SimpleCrossAttnUpBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



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




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase     ,					include_encoder_hidden_states=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							Tuple	) ->			Any:




     """simple docstring"""
     snake_case_     ,     snake_case_            =       super().prepare_init_args_and_inputs_for_common()
     snake_case_            =       3_2
     return init_dict, inputs_dict



  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			Optional[int]:




     """simple docstring"""
     snake_case_            =       [0.2_645, 0.1_480, 0.0_909, 0.8_044, -0.9_758, -0.9_083, 0.0_994, -1.1_453, -0.7_402]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							AttnUpBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



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




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase	)



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




     """simple docstring"""
     snake_case_            =       [0.0_979, 0.1_326, 0.0_021, 0.0_659, 0.2_249, 0.0_059, 0.1_132, 0.5_952, 0.1_033]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							SkipUpBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



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




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							Tuple	) ->			str:




     """simple docstring"""
     snake_case_            =       [-0.0_893, -0.1_234, -0.1_506, -0.0_332, 0.0_123, -0.0_211, 0.0_566, 0.0_143, 0.0_362]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							AttnSkipUpBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



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




     """simple docstring"""
     return super().get_dummy_input(include_res_hidden_states_tuple=_lowerCAmelCase	)



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




     """simple docstring"""
     snake_case_            =       [0.0_361, 0.0_617, 0.2_787, -0.0_350, 0.0_342, 0.3_421, -0.0_843, 0.0_913, 0.3_015]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							UpDecoderBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



  @property
  def        lowerCAmelCase__	(  self							:							Union[str, Any]	) ->			Optional[int]:




     """simple docstring"""
     return super().get_dummy_input(include_temb=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							Any	) ->			Any:




     """simple docstring"""
     snake_case_            =       {"in_channels": 3_2, "out_channels": 3_2}

     snake_case_            =       self.dummy_input
     return init_dict, inputs_dict



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




     """simple docstring"""
     snake_case_            =       [0.4_404, 0.1_998, -0.9_886, -0.3_320, -0.3_128, -0.7_034, -0.6_955, -0.2_338, -0.3_137]
     super().test_output(_lowerCAmelCase	)






class      __lowerCAmelCase  (			a			,	unittest.TestCase       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							AttnUpDecoderBlockaD  # noqa F405
  _SCREAMING_SNAKE_CASE		     =							'up'



  @property
  def        lowerCAmelCase__	(  self							:							Tuple	) ->			int:




     """simple docstring"""
     return super().get_dummy_input(include_temb=_lowerCAmelCase	)



  def        lowerCAmelCase__	(  self							:							int	) ->			Dict:




     """simple docstring"""
     snake_case_            =       {"in_channels": 3_2, "out_channels": 3_2}

     snake_case_            =       self.dummy_input
     return init_dict, inputs_dict



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




     """simple docstring"""
     snake_case_            =       [0.6_738, 0.4_491, 0.1_055, 1.0_710, 0.7_316, 0.3_339, 0.3_352, 0.1_023, 0.3_568]
     super().test_output(_lowerCAmelCase	)




