
"""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


__UpperCAmelCase 					=    logging.get_logger(__name__)

__UpperCAmelCase 					=    {
    'MBZUAI/swiftformer-xs': 'https://huggingface.co/MBZUAI/swiftformer-xs/resolve/main/config.json',
}




class      _SCREAMING_SNAKE_CASE   (     A__				):
			UpperCAmelCase_    :Tuple												=		"swiftformer"






			def __init__(   self			,  __A=3			,  __A=[3, 3, 6, 4]			,  __A=[48, 56, 112, 220]			,  __A=4			,  __A=[True, True, True, True]			,  __A="gelu"			,  __A=3			,  __A=2			,  __A=1			,  __A=0.0			,  __A=True			,  __A=1E-5			,  __A=1E-5			,  **__A			,  )     ->	Union[str, Any]:
						super().__init__(**__A			)
						lowerCAmelCase_       :Tuple     	=    num_channels
						lowerCAmelCase_       :Any     	=    depths
						lowerCAmelCase_       :Optional[int]     	=    embed_dims
						lowerCAmelCase_       :Dict     	=    mlp_ratio
						lowerCAmelCase_       :List[Any]     	=    downsamples
						lowerCAmelCase_       :Optional[int]     	=    hidden_act
						lowerCAmelCase_       :List[Any]     	=    down_patch_size
						lowerCAmelCase_       :Optional[int]     	=    down_stride
						lowerCAmelCase_       :List[Any]     	=    down_pad
						lowerCAmelCase_       :Union[str, Any]     	=    drop_path_rate
						lowerCAmelCase_       :Optional[Any]     	=    use_layer_scale
						lowerCAmelCase_       :Tuple     	=    layer_scale_init_value
						lowerCAmelCase_       :Optional[Any]     	=    batch_norm_eps




class      _SCREAMING_SNAKE_CASE   (     A__				):
			UpperCAmelCase_    :List[str]												=		version.parse("1.11"				)






			@property
			def 					__lowerCAmelCase					(   self			)     ->	Mapping[str, Mapping[int, str]]:
						return OrderedDict(
						    [
						        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
						    ]			)






			@property
			def 					__lowerCAmelCase					(   self			)     ->	float:
						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 					=    {
    'configuration_marian': ['MARIAN_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MarianConfig', 'MarianOnnxConfig'],
}

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

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

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

try:
				if not is_flax_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase 					=    ['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 					=    _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)






