





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  lowerCAmelCase							(       SCREAMING_SNAKE_CASE_							,							SCREAMING_SNAKE_CASE_ ):
  __lowerCamelCase		=      'nat'

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







  def __init__(      self  :Optional[Any]   ,							_lowercase  :Union[str, Any]=4   ,							_lowercase  :Optional[int]=3   ,							_lowercase  :Optional[int]=64   ,							_lowercase  :Any=[3, 4, 6, 5]   ,							_lowercase  :Union[str, Any]=[2, 4, 8, 16]   ,							_lowercase  :Union[str, Any]=7   ,							_lowercase  :Tuple=3.0   ,							_lowercase  :str=True   ,							_lowercase  :List[Any]=0.0   ,							_lowercase  :str=0.0   ,							_lowercase  :str=0.1   ,							_lowercase  :int="gelu"   ,							_lowercase  :Any=0.02   ,							_lowercase  :Optional[Any]=1e-5   ,							_lowercase  :List[Any]=0.0   ,							_lowercase  :Optional[int]=None   ,							_lowercase  :Any=None   ,							**_lowercase  :Optional[int]   ,							):






     '''simple docstring'''





     super().__init__(**snake_case__ )

     lowercase__			       =  patch_size
     lowercase__			       =  num_channels
     lowercase__			       =  embed_dim
     lowercase__			       =  depths
     lowercase__			       =  len(snake_case__ )
     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(snake_case__ ) - 1) )
     lowercase__			       =  layer_scale_init_value
     lowercase__			       =  ['stem'] + [f'''stage{idx}''' for idx in range(1   ,							len(snake_case__ ) + 1 )]
     lowercase__			       =  get_aligned_output_features_output_indices(
         out_features=snake_case__   ,							out_indices=snake_case__   ,							stage_names=self.stage_names )













from transformers import HfArgumentParser, TensorFlowBenchmark, TensorFlowBenchmarkArguments


def _A       (   ):
   lowercase__			       =  HfArgumentParser(__magic_name__	)
   lowercase__			       =  parser.parse_args_into_dataclasses()[0]
   lowercase__			       =  TensorFlowBenchmark(args=__magic_name__	)
   try:
      lowercase__			       =  parser.parse_args_into_dataclasses()[0]
   except ValueError as e:
      lowercase__			       =  "Arg --no_{0} is no longer used, please use --no-{0} instead."
      lowercase__			       =  " ".join(str(__magic_name__	).split(" "	)[:-1]	)
      lowercase__			       =  ""
      lowercase__			       =  eval(str(__magic_name__	).split(" "	)[-1]	)
      lowercase__			       =  []
      for arg in depreciated_args:
         # arg[2:] removes '--'
         if arg[2:] in TensorFlowBenchmark.deprecated_args:
            # arg[5:] removes '--no_'
            full_error_msg += arg_error_msg.format(arg[5:]	)
         else:
            wrong_args.append(__magic_name__	)
      if len(__magic_name__	) > 0:
         lowercase__			       =  full_error_msg + begin_error_msg + str(__magic_name__	)
      raise ValueError(__magic_name__	)
   benchmark.run()


if __name__ == "__main__":
  main()






