





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


_lowerCamelCase 					=      logging.get_logger(__name__)

_lowerCamelCase 					=      {
    '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 	UpperCamelCase_							(  UpperCamelCase__					,	UpperCamelCase__     ):
							lowerCamelCase_							     =       "nat"

							lowerCamelCase_							     =       {
							    "num_attention_heads": "num_heads",
							    "num_hidden_layers": "num_layers",
							}


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



									"""simple docstring"""



									super().__init__(**__A		)

									SCREAMING_SNAKE_CASE__								=   patch_size
									SCREAMING_SNAKE_CASE__								=   num_channels
									SCREAMING_SNAKE_CASE__								=   embed_dim
									SCREAMING_SNAKE_CASE__								=   depths
									SCREAMING_SNAKE_CASE__								=   len(__A		)
									SCREAMING_SNAKE_CASE__								=   num_heads
									SCREAMING_SNAKE_CASE__								=   kernel_size
									SCREAMING_SNAKE_CASE__								=   mlp_ratio
									SCREAMING_SNAKE_CASE__								=   qkv_bias
									SCREAMING_SNAKE_CASE__								=   hidden_dropout_prob
									SCREAMING_SNAKE_CASE__								=   attention_probs_dropout_prob
									SCREAMING_SNAKE_CASE__								=   drop_path_rate
									SCREAMING_SNAKE_CASE__								=   hidden_act
									SCREAMING_SNAKE_CASE__								=   layer_norm_eps
									SCREAMING_SNAKE_CASE__								=   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
									SCREAMING_SNAKE_CASE__								=   int(embed_dim * 2 ** (len(__A		) - 1)		)
									SCREAMING_SNAKE_CASE__								=   layer_scale_init_value
									SCREAMING_SNAKE_CASE__								=   ["""stem"""] + [f'''stage{idx}''' for idx in range(1				,					len(__A		) + 1		)]
									SCREAMING_SNAKE_CASE__						,    SCREAMING_SNAKE_CASE__								=   get_aligned_output_features_output_indices(
									    out_features=__A				,					out_indices=__A				,					stage_names=self.stage_names		)






def 					SCREAMING_SNAKE_CASE__				(							UpperCamelCase__:				float       , UpperCamelCase__:				float     ):
		if mass < 0:
				raise ValueError("""The mass of a body cannot be negative"""     )
		return 0.5 * mass * abs(UpperCamelCase__     ) * abs(UpperCamelCase__     )


if __name__ == "__main__":
	import doctest

	doctest.testmod(verbose=True)