






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


snake_case__   :						Any													=   logging.get_logger(__name__)

snake_case__   :						str													=   {
    """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							(	UpperCAmelCase__    ,							UpperCAmelCase__     ):






  """simple docstring"""





  A_						       = """nat"""

  A_						       = {
      """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.0_2		,		_UpperCAmelCase=1e-5		,		_UpperCAmelCase=0.0		,		_UpperCAmelCase=None		,		_UpperCAmelCase=None		,		**_UpperCAmelCase		,		)      ->			List[Any]:
     super().__init__(**_UpperCAmelCase			)

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







'''simple docstring'''

import os


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_doctest_list.py
snake_case									=    """."""


if __name__ == "__main__":
     snake_case									=    os.path.join(REPO_PATH, """utils/documentation_tests.txt""")
     snake_case									=    []
     snake_case									=    []
     with open(doctest_file_path) as fp:
          for line in fp:
               snake_case									=    line.strip()
               snake_case									=    os.path.join(REPO_PATH, line)
               if not (os.path.isfile(path) or os.path.isdir(path)):
                    non_existent_paths.append(line)
               all_paths.append(path)
     if len(non_existent_paths) > 0:
          snake_case									=    """\n""".join(non_existent_paths)
          raise ValueError(f'`utils/documentation_tests.txt` contains non-existent paths:\n{non_existent_paths}')
     if all_paths != sorted(all_paths):
          raise ValueError("""Files in `utils/documentation_tests.txt` are not in alphabetical order.""")





