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


snake_case__				= logging.get_logger(__name__)

snake_case__				= {
    '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'''

     A_										=  'nat'

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



     def __init__(					self				,				A_=4				,				A_=3				,				A_=64				,				A_=[3, 4, 6, 5]				,				A_=[2, 4, 8, 16]				,				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_				,				) ->				List[str]:






           """simple docstring"""
           super().__init__(**A_						)

           _lowerCamelCase			    =				patch_size
           _lowerCamelCase			    =				num_channels
           _lowerCamelCase			    =				embed_dim
           _lowerCamelCase			    =				depths
           _lowerCamelCase			    =				len(A_						)
           _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(A_						) - 1)						)
           _lowerCamelCase			    =				layer_scale_init_value
           _lowerCamelCase			    =				['''stem'''] + [F'stage{idx}' for idx in range(1				,				len(A_						) + 1						)]
           _lowerCamelCase    ,					_lowerCamelCase			    =				get_aligned_output_features_output_indices(
               out_features=A_				,				out_indices=A_				,				stage_names=self.stage_names						)
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase		)						->    str:



      '''simple docstring'''

      _lowerCamelCase			    =				0
      while b > 0:
            if b & 1:
                  res += a

            a += a
            b >>= 1

      return res
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase ,						__UpperCAmelCase		)						->    Optional[Any]:



      '''simple docstring'''

      _lowerCamelCase			    =				0
      while b > 0:
            if b & 1:
                  _lowerCamelCase			    =				((res % c) + (a % c)) % c

            a += a
            b >>= 1

      return res