


"""simple docstring"""






import importlib.metadata
from typing import Union

from packaging.version import Version, parse

from .constants import STR_OPERATION_TO_FUNC


_lowerCAmelCase							:    List[str]					   =	parse(importlib.metadata.version('''torch'''))







def        lowerCamelCase_(		_lowerCamelCase			,		_lowerCamelCase			,		_lowerCamelCase       )    ->     List[Any]:
   '''simple docstring'''





   if operation not in STR_OPERATION_TO_FUNC.keys():
      raise ValueError(F"""`operation` must be one of {list(STR_OPERATION_TO_FUNC.keys()       )}, received {operation}"""       )
   _lowerCamelCase   :				Any							=     STR_OPERATION_TO_FUNC[operation]
   if isinstance(_lowerCamelCase			,		_lowerCamelCase       ):
      _lowerCamelCase   :				Any							=     parse(importlib.metadata.version(_lowerCamelCase       )       )
   return operation(_lowerCamelCase			,		parse(_lowerCamelCase       )       )







def        lowerCamelCase_(		_lowerCamelCase			,		_lowerCamelCase       )    ->     int:
   '''simple docstring'''





   return compare_versions(_lowerCamelCase			,		_lowerCamelCase			,		_lowerCamelCase       )


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


a__												=						logging.get_logger(__name__)

a__												=						{
    '''google/mobilenet_v1_1.0_224''': '''https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json''',
    '''google/mobilenet_v1_0.75_192''': '''https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json''',
    # See all MobileNetV1 models at https://huggingface.co/models?filter=mobilenet_v1
}

class 							UpperCAmelCase_						(     __lowercase  ):
							"""simple docstring"""







							UpperCAmelCase__			:		int             =       "mobilenet_v1"


							def __init__(     self			,				_a=3			,				_a=2_2_4			,				_a=1.0			,				_a=8			,				_a="relu6"			,				_a=True			,				_a=0.999			,				_a=0.02			,				_a=0.001			,				**_a			,				)       ->       List[Any]:
												super().__init__(**_a			)

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

												_a      :       Tuple   =						num_channels
												_a      :       str   =						image_size
												_a      :       Tuple   =						depth_multiplier
												_a      :       Any   =						min_depth
												_a      :       int   =						hidden_act
												_a      :       Optional[Any]   =						tf_padding
												_a      :       str   =						classifier_dropout_prob
												_a      :       Optional[int]   =						initializer_range
												_a      :       Any   =						layer_norm_eps



class 							UpperCAmelCase_						(     __lowercase  ):
							"""simple docstring"""







							UpperCAmelCase__			:		str             =       version.parse("1.11"  )


							@property
							def 							__lowercase							(     self			)       ->       Mapping[str, Mapping[int, str]]:
												return OrderedDict([('''pixel_values''', {0: '''batch'''})]			)


							@property
							def 							__lowercase							(     self			)       ->       Mapping[str, Mapping[int, str]]:
												if self.task == "image-classification":
																	return OrderedDict([('''logits''', {0: '''batch'''})]			)
												else:
																	return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]			)




							@property
							def 							__lowercase							(     self			)       ->       float:
												return 1e-4



