


import argparse
import gc
import json
import os
import re

import torch
from huggingface_hub import hf_hub_download

from transformers import AutoModelForCausalLM, AutoTokenizer, PreTrainedTokenizerFast, RwkvConfig
from transformers.modeling_utils import WEIGHTS_INDEX_NAME, shard_checkpoint


SCREAMING_SNAKE_CASE :   int							      =				{
    "169M": 12,
    "430M": 24,
    "1B5": 24,
    "3B": 32,
    "7B": 32,
    "14B": 40,
}

SCREAMING_SNAKE_CASE :   Union[str, Any]							      =				{
    "169M": 768,
    "430M": 1024,
    "1B5": 2048,
    "3B": 2560,
    "7B": 4096,
    "14B": 5120,
}



def        UpperCamelCase_(   lowerCamelCase_				)					->		Dict:
    _lowercase :							Union[str, Any]   	=	list(state_dict.keys()				)
    for name in state_dict_keys:
        _lowercase :							List[str]   	=	state_dict.pop(__lowercase				)
        # emb -> embedding
        if name.startswith('emb.'				):
            _lowercase :							Any   	=	name.replace('emb.'							,				'embeddings.'				)
        # ln_0 -> pre_ln (only present at block 0)
        if name.startswith('blocks.0.ln0'				):
            _lowercase :							Union[str, Any]   	=	name.replace('blocks.0.ln0'							,				'blocks.0.pre_ln'				)
        # att -> attention
        _lowercase :							int   	=	re.sub(R'blocks\.(\d+)\.att'							,				R'blocks.\1.attention'							,				__lowercase				)
        # ffn -> feed_forward
        _lowercase :							int   	=	re.sub(R'blocks\.(\d+)\.ffn'							,				R'blocks.\1.feed_forward'							,				__lowercase				)
        # time_mix_k -> time_mix_key and reshape
        if name.endswith('.time_mix_k'				):
            _lowercase :							Optional[int]   	=	name.replace('.time_mix_k'							,				'.time_mix_key'				)
        # time_mix_v -> time_mix_value and reshape
        if name.endswith('.time_mix_v'				):
            _lowercase :							str   	=	name.replace('.time_mix_v'							,				'.time_mix_value'				)
        # time_mix_r -> time_mix_key and reshape
        if name.endswith('.time_mix_r'				):
            _lowercase :							Dict   	=	name.replace('.time_mix_r'							,				'.time_mix_receptance'				)

        if name != "head.weight":
            _lowercase :							int   	=	'rwkv.' + name

        _lowercase :							str   	=	weight
    return state_dict



def        UpperCamelCase_(   lowerCamelCase_							,				lowerCamelCase_							,				lowerCamelCase_							,				lowerCamelCase_=None							,				lowerCamelCase_=None							,				lowerCamelCase_=False							,				lowerCamelCase_=None				)					->		Tuple:




    if tokenizer_file is None:
        print('No `--tokenizer_file` provided, we will use the default tokenizer.'				)
        _lowercase :							int   	=	5_0277
        _lowercase :							List[str]   	=	AutoTokenizer.from_pretrained('EleutherAI/gpt-neox-20b'				)
    else:
        _lowercase :							List[str]   	=	PreTrainedTokenizerFast(tokenizer_file=__lowercase				)
        _lowercase :							Optional[Any]   	=	len(__lowercase				)
    tokenizer.save_pretrained(__lowercase				)

    # 2. Build the config
    _lowercase :							List[Any]   	=	list(NUM_HIDDEN_LAYERS_MAPPING.keys()				)
    if size is None:
        # Try to infer size from the checkpoint name
        for candidate in possible_sizes:
            if candidate in checkpoint_file:
                _lowercase :							List[Any]   	=	candidate
                break
        if size is None:
            raise ValueError('Could not infer the size, please provide it with the `--size` argument.'				)
    if size not in possible_sizes:
        raise ValueError(F'''`size` should be one of {possible_sizes}, got {size}.'''				)

    _lowercase :							Optional[Any]   	=	RwkvConfig(
        vocab_size=__lowercase							,				num_hidden_layers=NUM_HIDDEN_LAYERS_MAPPING[size]							,				hidden_size=HIDEN_SIZE_MAPPING[size]							,				)
    config.save_pretrained(__lowercase				)

    # 3. Download model file then convert state_dict
    _lowercase :							Optional[Any]   	=	hf_hub_download(__lowercase							,				__lowercase				)
    _lowercase :							Optional[int]   	=	torch.load(__lowercase							,				map_location='cpu'				)
    _lowercase :							List[Any]   	=	convert_state_dict(__lowercase				)

    # 4. Split in shards and save
    _lowercase :							Optional[Any]   	=	shard_checkpoint(__lowercase				)
    for shard_file, shard in shards.items():
        torch.save(__lowercase							,				os.path.join(__lowercase							,				__lowercase				)				)

    if index is not None:
        _lowercase :							Dict   	=	os.path.join(__lowercase							,				__lowercase				)
        # Save the index as well
        with open(__lowercase							,				'w'							,				encoding='utf-8'				) as f:
            _lowercase :							int   	=	json.dumps(__lowercase							,				indent=2							,				sort_keys=__lowercase				) + '\n'
            f.write(__lowercase				)

        # 5. Clean up shards (for some reason the file PyTorch saves take the same space as the whole state_dict
        print(
            'Cleaning up shards. This may error with an OOM error, it this is the case don\'t worry you still have converted the model.'				)
        _lowercase :							Any   	=	list(shards.keys()				)

        del state_dict
        del shards
        gc.collect()

        for shard_file in shard_files:
            _lowercase :							List[Any]   	=	torch.load(os.path.join(__lowercase							,				__lowercase				)				)
            torch.save({k: v.cpu().clone() for k, v in state_dict.items()}							,				os.path.join(__lowercase							,				__lowercase				)				)

    del state_dict
    gc.collect()

    if push_to_hub:
        if model_name is None:
            raise ValueError('Please provide a `model_name` to push the model to the Hub.'				)
        _lowercase :							str   	=	AutoModelForCausalLM.from_pretrained(__lowercase				)
        model.push_to_hub(__lowercase							,				max_shard_size='2GB'				)
        tokenizer.push_to_hub(__lowercase				)


if __name__ == "__main__":
 SCREAMING_SNAKE_CASE :   List[str]							      =				argparse.ArgumentParser()
 # Required parameters
 parser.add_argument(
     "--repo_id", default=None, type=str, required=True, help="Repo ID from which to pull the checkpoint."
 )
 parser.add_argument(
     "--checkpoint_file", default=None, type=str, required=True, help="Name of the checkpoint file in the repo."
 )
 parser.add_argument(
     "--output_dir", default=None, type=str, required=True, help="Where to save the converted model."
 )
 parser.add_argument(
     "--tokenizer_file",
     default=None,
     type=str,
     help="Path to the tokenizer file to use (if not provided, only the model is converted).",
 )
 parser.add_argument(
     "--size",
     default=None,
     type=str,
     help="Size of the model. Will be inferred from the `checkpoint_file` if not passed.",
 )
 parser.add_argument(
     "--push_to_hub",
     action="store_true",
     help="Push to the Hub the converted model.",
 )
 parser.add_argument(
     "--model_name",
     default=None,
     type=str,
     help="Name of the pushed model on the Hub, including the username / organization.",
 )

 SCREAMING_SNAKE_CASE :   Tuple							      =				parser.parse_args()
 convert_rmkv_checkpoint_to_hf_format(
     args.repo_id,
     args.checkpoint_file,
     args.output_dir,
     size=args.size,
     tokenizer_file=args.tokenizer_file,
     push_to_hub=args.push_to_hub,
     model_name=args.model_name,
 )



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)


