



"""simple docstring"""

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


lowercase__       :    List[Any]				       =      logging.get_logger(__name__)

lowercase__       :    int				       =      {
    """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			(     snake_case__):
 _lowerCAmelCase  :     Any						   =						'mobilenet_v2'

 def __init__(	self						:			int    ,	lowercase_						:			Tuple=3    ,	lowercase_						:			Dict=224    ,	lowercase_						:			str=1.0    ,	lowercase_						:			Any=8    ,	lowercase_						:			str=8    ,	lowercase_						:			Any=6    ,	lowercase_						:			int=32    ,	lowercase_						:			Tuple=True    ,	lowercase_						:			Tuple=True    ,	lowercase_						:			Optional[Any]="relu6"    ,	lowercase_						:			List[Any]=True    ,	lowercase_						:			List[Any]=0.8    ,	lowercase_						:			Optional[Any]=0.02    ,	lowercase_						:			int=0.0_01    ,	lowercase_						:			Optional[Any]=255    ,	**lowercase_						:			Any    ,	):
     super().__init__(**lowercase_							)

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

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





class 			_UpperCAmelCase			(     snake_case__):
 _lowerCAmelCase  :     Any						   =						version.parse("""1.11""")

 @property
 def 		_snake_case   (	self						:			str							):
     return OrderedDict([('''pixel_values''', {0: '''batch'''})]							)

 @property
 def 		_snake_case   (	self						:			Optional[int]							):
     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						:			Tuple							):
     return 1E-4












from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_lowercase		:  Dict			       ={
    """configuration_resnet""": ["""RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ResNetConfig""", """ResNetOnnxConfig"""]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Union[str, Any]			       =[
		    """RESNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """ResNetForImageClassification""",
		    """ResNetModel""",
		    """ResNetPreTrainedModel""",
		    """ResNetBackbone""",
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Union[str, Any]			       =[
		    """TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """TFResNetForImageClassification""",
		    """TFResNetModel""",
		    """TFResNetPreTrainedModel""",
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Tuple			       =[
		    """FlaxResNetForImageClassification""",
		    """FlaxResNetModel""",
		    """FlaxResNetPreTrainedModel""",
		]

if TYPE_CHECKING:
		from .configuration_resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig, ResNetOnnxConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_resnet import (
				    RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ResNetBackbone,
				    ResNetForImageClassification,
				    ResNetModel,
				    ResNetPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_resnet import (
				    TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFResNetForImageClassification,
				    TFResNetModel,
				    TFResNetPreTrainedModel,
				)

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_resnet import FlaxResNetForImageClassification, FlaxResNetModel, FlaxResNetPreTrainedModel


else:
		import sys

		_lowercase		:  Union[str, Any]			       =_LazyModule(__name__, globals()["""__file__"""], _import_structure)
