






"""simple docstring"""





from ..utils import DummyObject, requires_backends






class 	a		(   metaclass=lowercase__						):
    SCREAMING_SNAKE_CASE		:	List[Any]		=					["""flax""", """transformers"""]






    def __init__(			self	:				List[Any]			,		*__SCREAMING_SNAKE_CASE	:				Union[str, Any]			,		**__SCREAMING_SNAKE_CASE	:				Union[str, Any]   )	->						str:
      requires_backends(self			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				List[Any]			,		*__SCREAMING_SNAKE_CASE	:				List[Any]			,		**__SCREAMING_SNAKE_CASE	:				int   )	->						Optional[int]:
      requires_backends(cls			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				List[Any]			,		*__SCREAMING_SNAKE_CASE	:				str			,		**__SCREAMING_SNAKE_CASE	:				Union[str, Any]   )	->						Union[str, Any]:
      requires_backends(cls			,		['flax', 'transformers']   )






class 	a		(   metaclass=lowercase__						):
    SCREAMING_SNAKE_CASE		:	Optional[Any]		=					["""flax""", """transformers"""]






    def __init__(			self	:				int			,		*__SCREAMING_SNAKE_CASE	:				List[Any]			,		**__SCREAMING_SNAKE_CASE	:				Any   )	->						Union[str, Any]:
      requires_backends(self			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				int			,		*__SCREAMING_SNAKE_CASE	:				str			,		**__SCREAMING_SNAKE_CASE	:				int   )	->						Optional[Any]:
      requires_backends(cls			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				List[str]			,		*__SCREAMING_SNAKE_CASE	:				List[str]			,		**__SCREAMING_SNAKE_CASE	:				Optional[Any]   )	->						Dict:
      requires_backends(cls			,		['flax', 'transformers']   )






class 	a		(   metaclass=lowercase__						):
    SCREAMING_SNAKE_CASE		:	Optional[Any]		=					["""flax""", """transformers"""]






    def __init__(			self	:				Tuple			,		*__SCREAMING_SNAKE_CASE	:				Optional[int]			,		**__SCREAMING_SNAKE_CASE	:				Dict   )	->						List[str]:
      requires_backends(self			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				Tuple			,		*__SCREAMING_SNAKE_CASE	:				Dict			,		**__SCREAMING_SNAKE_CASE	:				Optional[Any]   )	->						List[Any]:
      requires_backends(cls			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				Tuple			,		*__SCREAMING_SNAKE_CASE	:				Tuple			,		**__SCREAMING_SNAKE_CASE	:				Tuple   )	->						Union[str, Any]:
      requires_backends(cls			,		['flax', 'transformers']   )






class 	a		(   metaclass=lowercase__						):
    SCREAMING_SNAKE_CASE		:	Optional[int]		=					["""flax""", """transformers"""]






    def __init__(			self	:				Optional[Any]			,		*__SCREAMING_SNAKE_CASE	:				Any			,		**__SCREAMING_SNAKE_CASE	:				str   )	->						Union[str, Any]:
      requires_backends(self			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				List[Any]			,		*__SCREAMING_SNAKE_CASE	:				Optional[Any]			,		**__SCREAMING_SNAKE_CASE	:				Optional[int]   )	->						Union[str, Any]:
      requires_backends(cls			,		['flax', 'transformers']   )






    @classmethod
    def   UpperCamelCase			(			cls	:				List[Any]			,		*__SCREAMING_SNAKE_CASE	:				List[Any]			,		**__SCREAMING_SNAKE_CASE	:				List[Any]   )	->						Optional[Any]:
      requires_backends(cls			,		['flax', 'transformers']   )






"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCAmelCase        =				logging.get_logger(__name__)

UpperCAmelCase        =				{
    """shi-labs/nat-mini-in1k-224""": """https://huggingface.co/shi-labs/nat-mini-in1k-224/resolve/main/config.json""",
    # See all Nat models at https://huggingface.co/models?filter=nat
}



class 			lowercase					( lowercase__   ,lowercase__		):
			lowercase        =     '''nat'''

			lowercase        =     {
			    '''num_attention_heads''': '''num_heads''',
			    '''num_hidden_layers''': '''num_layers''',
			}






			def __init__(self  :	Union[str, Any]      ,SCREAMING_SNAKE_CASE_  :	Optional[Any]=4      ,SCREAMING_SNAKE_CASE_  :	Dict=3      ,SCREAMING_SNAKE_CASE_  :	int=64      ,SCREAMING_SNAKE_CASE_  :	Tuple=[3, 4, 6, 5]      ,SCREAMING_SNAKE_CASE_  :	Dict=[2, 4, 8, 16]      ,SCREAMING_SNAKE_CASE_  :	Optional[int]=7      ,SCREAMING_SNAKE_CASE_  :	Optional[Any]=3.0      ,SCREAMING_SNAKE_CASE_  :	Optional[Any]=True      ,SCREAMING_SNAKE_CASE_  :	Any=0.0      ,SCREAMING_SNAKE_CASE_  :	List[Any]=0.0      ,SCREAMING_SNAKE_CASE_  :	Dict=0.1      ,SCREAMING_SNAKE_CASE_  :	Tuple="gelu"      ,SCREAMING_SNAKE_CASE_  :	str=0.02      ,SCREAMING_SNAKE_CASE_  :	str=1e-5      ,SCREAMING_SNAKE_CASE_  :	int=0.0      ,SCREAMING_SNAKE_CASE_  :	List[Any]=None      ,SCREAMING_SNAKE_CASE_  :	Tuple=None      ,**SCREAMING_SNAKE_CASE_  :	Union[str, Any]      ,)       ->	Tuple:





				"""simple docstring"""


				super().__init__(**SCREAMING_SNAKE_CASE_			)

				lowerCAmelCase												=  patch_size
				lowerCAmelCase												=  num_channels
				lowerCAmelCase												=  embed_dim
				lowerCAmelCase												=  depths
				lowerCAmelCase												=  len(SCREAMING_SNAKE_CASE_			)
				lowerCAmelCase												=  num_heads
				lowerCAmelCase												=  kernel_size
				lowerCAmelCase												=  mlp_ratio
				lowerCAmelCase												=  qkv_bias
				lowerCAmelCase												=  hidden_dropout_prob
				lowerCAmelCase												=  attention_probs_dropout_prob
				lowerCAmelCase												=  drop_path_rate
				lowerCAmelCase												=  hidden_act
				lowerCAmelCase												=  layer_norm_eps
				lowerCAmelCase												=  initializer_range
				# we set the hidden_size attribute in order to make Nat work with VisionEncoderDecoderModel
				# this indicates the channel dimension after the last stage of the model
				lowerCAmelCase												=  int(embed_dim * 2 ** (len(SCREAMING_SNAKE_CASE_			) - 1)			)
				lowerCAmelCase												=  layer_scale_init_value
				lowerCAmelCase												=  ['''stem'''] + [F"""stage{idx}""" for idx in range(1      ,len(SCREAMING_SNAKE_CASE_			) + 1			)]
				lowerCAmelCase							,       lowerCAmelCase												=  get_aligned_output_features_output_indices(
				    out_features=SCREAMING_SNAKE_CASE_      ,out_indices=SCREAMING_SNAKE_CASE_      ,stage_names=self.stage_names			)


