



'''simple docstring'''


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


lowercase              =			logging.get_logger(__name__)

lowercase              =			{
    '''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	(		__lowerCamelCase					,	__lowerCamelCase):


 '''simple docstring'''




 __magic_name__					: Tuple  =      "nat"

 __magic_name__					: int  =      {
     "num_attention_heads": "num_heads",
     "num_hidden_layers": "num_layers",
 }




 def __init__(   self							,  lowerCAmelCase_=4							,  lowerCAmelCase_=3							,  lowerCAmelCase_=6_4							,  lowerCAmelCase_=[3, 4, 6, 5]							,  lowerCAmelCase_=[2, 4, 8, 1_6]							,  lowerCAmelCase_=7							,  lowerCAmelCase_=3.0							,  lowerCAmelCase_=True							,  lowerCAmelCase_=0.0							,  lowerCAmelCase_=0.0							,  lowerCAmelCase_=0.1							,  lowerCAmelCase_="gelu"							,  lowerCAmelCase_=0.0_2							,  lowerCAmelCase_=1e-5							,  lowerCAmelCase_=0.0							,  lowerCAmelCase_=None							,  lowerCAmelCase_=None							,  **lowerCAmelCase_							,  ) ->      Dict:



      """simple docstring"""







      super().__init__(**UpperCAmelCase_)

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







'''simple docstring'''


from .testing import (
    are_the_same_tensors,
    execute_subprocess_async,
    require_bnb,
    require_cpu,
    require_cuda,
    require_huggingface_suite,
    require_mps,
    require_multi_gpu,
    require_multi_xpu,
    require_safetensors,
    require_single_gpu,
    require_single_xpu,
    require_torch_min_version,
    require_tpu,
    require_xpu,
    skip,
    slow,
)
from .training import RegressionDataset, RegressionModel, RegressionModelaXPU


from .scripts import test_script, test_sync, test_ops  # isort: skip


