



"""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      :      int   					=					logging.get_logger(__name__)

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

class 	__lowerCAmelCase							(snake_case__  ):


					'''simple docstring'''


					a__        =     'swiftformer'







					def __init__(      self    ,       a=3    ,       a=[3, 3, 6, 4]    ,       a=[48, 56, 1_12, 2_20]    ,       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    ,       ):




										"""simple docstring"""





										super().__init__(**a   )
										snake_case_						:List[str]								=						num_channels
										snake_case_						:Tuple								=						depths
										snake_case_						:int								=						embed_dims
										snake_case_						:str								=						mlp_ratio
										snake_case_						:str								=						downsamples
										snake_case_						:List[Any]								=						hidden_act
										snake_case_						:Tuple								=						down_patch_size
										snake_case_						:List[Any]								=						down_stride
										snake_case_						:Tuple								=						down_pad
										snake_case_						:Any								=						drop_path_rate
										snake_case_						:Union[str, Any]								=						use_layer_scale
										snake_case_						:Any								=						layer_scale_init_value
										snake_case_						:Dict								=						batch_norm_eps



class 	__lowerCAmelCase							(snake_case__  ):


					'''simple docstring'''


					a__        =     version.parse('1.11'  )







					@property
					def 		_a (      self   ):




										"""simple docstring"""





										return OrderedDict(
										    [
										        ("pixel_values", {0: "batch", 1: "num_channels", 2: "height", 3: "width"}),
										    ]   )







					@property
					def 		_a (      self   ):




										"""simple docstring"""





										return 1e-4










"""simple docstring"""






from typing import TYPE_CHECKING

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


__UpperCAmelCase      :      Optional[int]   					=					{
    'configuration_segformer': ['SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SegformerConfig', 'SegformerOnnxConfig']
}

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase      :      int   					=					['SegformerFeatureExtractor']
				__UpperCAmelCase      :      Dict   					=					['SegformerImageProcessor']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase      :      Optional[Any]   					=					[
				    'SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'SegformerDecodeHead',
				    'SegformerForImageClassification',
				    'SegformerForSemanticSegmentation',
				    'SegformerLayer',
				    'SegformerModel',
				    'SegformerPreTrainedModel',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase      :      Dict   					=					[
				    'TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'TFSegformerDecodeHead',
				    'TFSegformerForImageClassification',
				    'TFSegformerForSemanticSegmentation',
				    'TFSegformerModel',
				    'TFSegformerPreTrainedModel',
				]


if TYPE_CHECKING:
				from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_segformer import SegformerFeatureExtractor
								from .image_processing_segformer import SegformerImageProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_segformer import (
								    SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
								    SegformerDecodeHead,
								    SegformerForImageClassification,
								    SegformerForSemanticSegmentation,
								    SegformerLayer,
								    SegformerModel,
								    SegformerPreTrainedModel,
								)
				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_segformer import (
								    TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFSegformerDecodeHead,
								    TFSegformerForImageClassification,
								    TFSegformerForSemanticSegmentation,
								    TFSegformerModel,
								    TFSegformerPreTrainedModel,
								)

else:
				import sys

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

