






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


A__	:			Tuple			   = logging.get_logger(__name__)

A__	:			Any			   = {
    '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					(       A__		,A__	):

				"""simple docstring"""




				lowercase__											=       "nat"

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




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

								'''simple docstring'''
								super().__init__(**__A  )

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








from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_snake_case             =     logging.get_logger(__name__)

_snake_case             =     {
    '''google/mobilenet_v2_1.4_224''': '''https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json''',
    '''google/mobilenet_v2_1.0_224''': '''https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json''',
    '''google/mobilenet_v2_0.75_160''': '''https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json''',
    '''google/mobilenet_v2_0.35_96''': '''https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json''',
    # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2
}
class 	UpperCAmelCase_					(					UpperCamelCase    ):

   '''simple docstring'''




   __A :      Dict     		=		"mobilenet_v2"






   def __init__(		self						,				__A=3						,				__A=224						,				__A=1.0						,				__A=8						,				__A=8						,				__A=6						,				__A=32						,				__A=True						,				__A=True						,				__A="relu6"						,				__A=True						,				__A=0.8						,				__A=0.02						,				__A=0.001						,				__A=255						,				**__A						,				):






     """simple docstring"""





     super().__init__(**__A )

     if depth_multiplier <= 0:
       raise ValueError("depth_multiplier must be greater than zero." )

     lowerCamelCase :					str    =				num_channels
     lowerCamelCase :					Any    =				image_size
     lowerCamelCase :					Union[str, Any]    =				depth_multiplier
     lowerCamelCase :					Tuple    =				depth_divisible_by
     lowerCamelCase :					Dict    =				min_depth
     lowerCamelCase :					Dict    =				expand_ratio
     lowerCamelCase :					Optional[Any]    =				output_stride
     lowerCamelCase :					int    =				first_layer_is_expansion
     lowerCamelCase :					Union[str, Any]    =				finegrained_output
     lowerCamelCase :					Optional[Any]    =				hidden_act
     lowerCamelCase :					Optional[Any]    =				tf_padding
     lowerCamelCase :					Optional[Any]    =				classifier_dropout_prob
     lowerCamelCase :					Dict    =				initializer_range
     lowerCamelCase :					str    =				layer_norm_eps
     lowerCamelCase :					Optional[Any]    =				semantic_loss_ignore_index



class 	UpperCAmelCase_					(					UpperCamelCase    ):

   '''simple docstring'''




   __A :      Union[str, Any]     		=		version.parse("1.11"    )






   @property
   def _snake_case    (		self ):






     """simple docstring"""





     return OrderedDict([("pixel_values", {0: "batch"})] )






   @property
   def _snake_case    (		self ):






     """simple docstring"""





     if self.task == "image-classification":
       return OrderedDict([("logits", {0: "batch"})] )
     else:
       return OrderedDict([("last_hidden_state", {0: "batch"}), ("pooler_output", {0: "batch"})] )






   @property
   def _snake_case    (		self ):






     """simple docstring"""





     return 1e-4



