





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		:				Dict      		=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        snake_case__    (__lowercase		):







						"""simple docstring"""




						__lowerCAmelCase					:List[str]      =					"mobilenet_v2"

						def __init__(       self ,       __lowercase=3 ,       __lowercase=2_2_4 ,       __lowercase=1.0 ,       __lowercase=8 ,       __lowercase=8 ,       __lowercase=6 ,       __lowercase=3_2 ,       __lowercase=True ,       __lowercase=True ,       __lowercase="relu6" ,       __lowercase=True ,       __lowercase=0.8 ,       __lowercase=0.0_2 ,       __lowercase=0.0_0_1 ,       __lowercase=2_5_5 ,       **__lowercase ,       ) ->				Dict:
									"""simple docstring"""




									super().__init__(**_a  )

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

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




class        snake_case__    (__lowercase		):







						"""simple docstring"""




						__lowerCAmelCase					:Tuple      =					version.parse("1.11"		)

						@property
						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				Mapping[str, Mapping[int, str]]:
									"""simple docstring"""




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

						@property
						def 							SCREAMING_SNAKE_CASE__(       self  ) ->				Mapping[str, Mapping[int, str]]:
									"""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 							SCREAMING_SNAKE_CASE__(       self  ) ->				float:
									"""simple docstring"""




									return 1E-4









import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
		import ctypes
		import msvcrt  # noqa

		class        snake_case__    (ctypes.Structure		):







								"""simple docstring"""




								__lowerCAmelCase					:Dict      =					[("size", ctypes.c_int), ("visible", ctypes.c_byte)]

def      lowerCAmelCase_					(  )							->	List[Any]:







			"""simple docstring"""
			if os.name == "nt":
						a__       :						int							=  CursorInfo()
						a__       :						Union[str, Any]							=  ctypes.windll.kernelaa.GetStdHandle(-11)
						ctypes.windll.kernelaa.GetConsoleCursorInfo(_lowercase						,       ctypes.byref(_lowercase))
						a__       :						List[str]							=  False
						ctypes.windll.kernelaa.SetConsoleCursorInfo(_lowercase						,       ctypes.byref(_lowercase))
			elif os.name == "posix":
						sys.stdout.write("""\033[?25l""")
						sys.stdout.flush()

def      lowerCAmelCase_					(  )							->	Optional[Any]:







			"""simple docstring"""
			if os.name == "nt":
						a__       :						List[Any]							=  CursorInfo()
						a__       :						Optional[int]							=  ctypes.windll.kernelaa.GetStdHandle(-11)
						ctypes.windll.kernelaa.GetConsoleCursorInfo(_lowercase						,       ctypes.byref(_lowercase))
						a__       :						Dict							=  True
						ctypes.windll.kernelaa.SetConsoleCursorInfo(_lowercase						,       ctypes.byref(_lowercase))
			elif os.name == "posix":
						sys.stdout.write("""\033[?25h""")
						sys.stdout.flush()





@contextmanager
def      lowerCAmelCase_					(  )							->	Any:







			"""simple docstring"""
			try:
						hide_cursor()
						yield
			finally:
						show_cursor()




