


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


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

lowerCAmelCase__  :Tuple             =							{
    '''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 		__a				(    UpperCAmelCase      ):
  _a     :  List[Any]           =     'mobilenet_v1'
  def __init__(      self      ,   _SCREAMING_SNAKE_CASE=3      ,   _SCREAMING_SNAKE_CASE=224      ,   _SCREAMING_SNAKE_CASE=1.0      ,   _SCREAMING_SNAKE_CASE=8      ,   _SCREAMING_SNAKE_CASE="relu6"      ,   _SCREAMING_SNAKE_CASE=True      ,   _SCREAMING_SNAKE_CASE=0.999      ,   _SCREAMING_SNAKE_CASE=0.02      ,   _SCREAMING_SNAKE_CASE=0.001      ,   **_SCREAMING_SNAKE_CASE      ,   )			->	Union[str, Any]:




         """simple docstring"""





         super().__init__(**_SCREAMING_SNAKE_CASE						)

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

         _UpperCAmelCase					=      num_channels
         _UpperCAmelCase					=      image_size
         _UpperCAmelCase					=      depth_multiplier
         _UpperCAmelCase					=      min_depth
         _UpperCAmelCase					=      hidden_act
         _UpperCAmelCase					=      tf_padding
         _UpperCAmelCase					=      classifier_dropout_prob
         _UpperCAmelCase					=      initializer_range
         _UpperCAmelCase					=      layer_norm_eps



class 		__a				(    UpperCAmelCase      ):
  _a     :  Any           =     version.parse('1.11'      )
  @property
  def      UpperCAmelCase__    (      self						)			->	Mapping[str, Mapping[int, str]]:




         """simple docstring"""





         return OrderedDict([('pixel_values', {0: 'batch'})]						)
  @property
  def      UpperCAmelCase__    (      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      UpperCAmelCase__    (      self						)			->	float:




         """simple docstring"""





         return 1e-4




from typing import TYPE_CHECKING

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


lowerCAmelCase__  :Tuple             =							{'''configuration_beit''': ['''BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''BeitConfig''', '''BeitOnnxConfig''']}

try:
		if not is_vision_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowerCAmelCase__  :List[Any]             =							['''BeitFeatureExtractor''']
		lowerCAmelCase__  :Optional[Any]             =							['''BeitImageProcessor''']

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowerCAmelCase__  :int             =							[
		    '''BEIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''BeitForImageClassification''',
		    '''BeitForMaskedImageModeling''',
		    '''BeitForSemanticSegmentation''',
		    '''BeitModel''',
		    '''BeitPreTrainedModel''',
		]


try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowerCAmelCase__  :Tuple             =							[
		    '''FlaxBeitForImageClassification''',
		    '''FlaxBeitForMaskedImageModeling''',
		    '''FlaxBeitModel''',
		    '''FlaxBeitPreTrainedModel''',
		]

if TYPE_CHECKING:
		from .configuration_beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig, BeitOnnxConfig

		try:
				if not is_vision_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_beit import BeitFeatureExtractor
				from .image_processing_beit import BeitImageProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_beit import (
				    BEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
				    BeitForImageClassification,
				    BeitForMaskedImageModeling,
				    BeitForSemanticSegmentation,
				    BeitModel,
				    BeitPreTrainedModel,
				)

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_beit import (
				    FlaxBeitForImageClassification,
				    FlaxBeitForMaskedImageModeling,
				    FlaxBeitModel,
				    FlaxBeitPreTrainedModel,
				)


else:
		import sys

		lowerCAmelCase__  :Dict             =							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
