"""simple docstring"""


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


lowerCAmelCase_:					int     =					logging.get_logger(__name__)

lowerCAmelCase_:					Tuple     =					{
    "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    a__    (   _a					,					_a	):
   snake_case_							=      "nat"

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


   def __init__(     self,				_UpperCAmelCase=4,				_UpperCAmelCase=3,				_UpperCAmelCase=64,				_UpperCAmelCase=[3, 4, 6, 5],				_UpperCAmelCase=[2, 4, 8, 16],				_UpperCAmelCase=7,				_UpperCAmelCase=3.0,				_UpperCAmelCase=True,				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.0,				_UpperCAmelCase=0.1,				_UpperCAmelCase="gelu",				_UpperCAmelCase=0.02,				_UpperCAmelCase=1E-5,				_UpperCAmelCase=0.0,				_UpperCAmelCase=None,				_UpperCAmelCase=None,				**_UpperCAmelCase,				):
        '''simple docstring'''



        super().__init__(**_UpperCAmelCase  )

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





"""simple docstring"""


from __future__ import annotations







def 					__a   (		A    ,				A      ):






     '''simple docstring'''



     if partitions <= 0:
          raise ValueError("partitions must be a positive number!"      )
     if partitions > number_of_bytes:
          raise ValueError("partitions can not > number_of_bytes!"      )
     lowercase__				 =							number_of_bytes // partitions
     lowercase__				 =							[]
     for i in range(A      ):
          lowercase__				 =							i * bytes_per_partition + 1
          lowercase__				 =							(
              number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
          )
          allocation_list.append(f'''{start_bytes}-{end_bytes}'''      )
     return allocation_list


if __name__ == "__main__":
 import doctest

 doctest.testmod()




