

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


a__												=						logging.get_logger(__name__)

a__												=						{
    '''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_						(     __lowercase							,			__lowercase  ):
							"""simple docstring"""







							UpperCAmelCase__			:		List[Any]             =       'nat'

							UpperCAmelCase__			:		List[str]             =       {
							    'num_attention_heads': 'num_heads',
							    'num_hidden_layers': 'num_layers',
							}


							def __init__(     self			,				_a=4			,				_a=3			,				_a=6_4			,				_a=[3, 4, 6, 5]			,				_a=[2, 4, 8, 1_6]			,				_a=7			,				_a=3.0			,				_a=True			,				_a=0.0			,				_a=0.0			,				_a=0.1			,				_a="gelu"			,				_a=0.02			,				_a=1e-5			,				_a=0.0			,				_a=None			,				_a=None			,				**_a			,				)       ->       Optional[Any]:
												super().__init__(**SCREAMING_SNAKE_CASE_			)

												_a      :       Any   =						patch_size
												_a      :       str   =						num_channels
												_a      :       Dict   =						embed_dim
												_a      :       Optional[int]   =						depths
												_a      :       Tuple   =						len(SCREAMING_SNAKE_CASE_			)
												_a      :       List[str]   =						num_heads
												_a      :       int   =						kernel_size
												_a      :       Dict   =						mlp_ratio
												_a      :       Any   =						qkv_bias
												_a      :       List[str]   =						hidden_dropout_prob
												_a      :       Optional[int]   =						attention_probs_dropout_prob
												_a      :       Dict   =						drop_path_rate
												_a      :       List[Any]   =						hidden_act
												_a      :       Any   =						layer_norm_eps
												_a      :       Optional[int]   =						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
												_a      :       Optional[int]   =						int(embed_dim * 2 ** (len(SCREAMING_SNAKE_CASE_			) - 1)			)
												_a      :       str   =						layer_scale_init_value
												_a      :       Tuple   =						['''stem'''] + [F"""stage{idx}""" for idx in range(1			,				len(SCREAMING_SNAKE_CASE_			) + 1			)]
												_a ,   _a      :       Any   =						get_aligned_output_features_output_indices(
												    out_features=SCREAMING_SNAKE_CASE_			,				out_indices=SCREAMING_SNAKE_CASE_			,				stage_names=self.stage_names			)





def 							a		(				snake_case__:   int   ):


				'''simple docstring'''
				if not isinstance(snake_case__		,  snake_case__   ):
								raise ValueError('''Input must be an integer'''   )
				if input_num <= 0:
								raise ValueError('''Input must be positive'''   )
				return sum(
				    divisor for divisor in range(1		,  input_num // 2 + 1   ) if input_num % divisor == 0   )


if __name__ == "__main__":
						import doctest

						doctest.testmod()




