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


_UpperCamelCase				:		Any       			=		logging.get_logger(__name__)

_UpperCamelCase				:		Any       			=		{
    'apple/mobilevitv2-1.0': 'https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json',
}

class   _lowercase(     _lowerCamelCase				):



   """simple docstring"""





   __lowerCamelCase    =  '''mobilevitv2'''





   def __init__(							self:    Union[str, Any]			,a:    Optional[int]=3			,a:    Any=256			,a:    str=2			,a:    Any=2.0			,a:    Union[str, Any]="swish"			,a:    List[str]=3			,a:    List[str]=32			,a:    int=0.1			,a:    List[Any]=0.02			,a:    List[Any]=1e-5			,a:    Tuple=512			,a:    Optional[Any]=[6, 12, 18]			,a:    Dict=0.1			,a:    List[Any]=255			,a:    Union[str, Any]=[2, 4, 3]			,a:    str=[128, 192, 256]			,a:    int=1.0			,a:    Optional[int]=2			,a:    Optional[Any]=0.0			,a:    int=0.0			,**a:    Optional[Any]			,):
    super().__init__(**a	)

    __UpperCAmelCase         =					num_channels
    __UpperCAmelCase         =					image_size
    __UpperCAmelCase         =					patch_size
    __UpperCAmelCase         =					expand_ratio
    __UpperCAmelCase         =					hidden_act
    __UpperCAmelCase         =					conv_kernel_size
    __UpperCAmelCase         =					output_stride
    __UpperCAmelCase         =					initializer_range
    __UpperCAmelCase         =					layer_norm_eps
    __UpperCAmelCase         =					n_attn_blocks
    __UpperCAmelCase         =					base_attn_unit_dims
    __UpperCAmelCase         =					width_multiplier
    __UpperCAmelCase         =					ffn_multiplier
    __UpperCAmelCase         =					ffn_dropout
    __UpperCAmelCase         =					attn_dropout
    __UpperCAmelCase         =					classifier_dropout_prob

    # decode head attributes for semantic segmentation
    __UpperCAmelCase         =					aspp_out_channels
    __UpperCAmelCase         =					atrous_rates
    __UpperCAmelCase         =					aspp_dropout_prob
    __UpperCAmelCase         =					semantic_loss_ignore_index




class   _lowercase(     _lowerCamelCase				):



   """simple docstring"""





   __lowerCamelCase    =  version.parse('''1.11'''				)





   @property
   def 			snake_case	(							self:    Optional[int]	):
    return OrderedDict([('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'})]	)





   @property
   def 			snake_case	(							self:    Tuple	):
    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:    Union[str, Any]	):
    return 1e-4




'''simple docstring'''




from typing import TYPE_CHECKING

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


_UpperCamelCase				:		Dict       			=		{
    'configuration_marian': ['MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MarianConfig', 'MarianOnnxConfig'],
}

try:
     if not is_sentencepiece_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase				:		Optional[int]       			=		['MarianTokenizer']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase				:		Dict       			=		[
         'MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST',
         'MarianForCausalLM',
         'MarianModel',
         'MarianMTModel',
         'MarianPreTrainedModel',
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase				:		Dict       			=		['TFMarianModel', 'TFMarianMTModel', 'TFMarianPreTrainedModel']

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _UpperCamelCase				:		Any       			=		['FlaxMarianModel', 'FlaxMarianMTModel', 'FlaxMarianPreTrainedModel']

if TYPE_CHECKING:
     from .configuration_marian import MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP, MarianConfig, MarianOnnxConfig

     try:
          if not is_sentencepiece_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_marian import MarianTokenizer

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_marian import (
              MARIAN_PRETRAINED_MODEL_ARCHIVE_LIST,
              MarianForCausalLM,
              MarianModel,
              MarianMTModel,
              MarianPreTrainedModel,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_marian import TFMarianModel, TFMarianMTModel, TFMarianPreTrainedModel

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_marian import FlaxMarianModel, FlaxMarianMTModel, FlaxMarianPreTrainedModel

else:
     import sys

     _UpperCamelCase				:		List[Any]       			=		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



