


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
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_snake_case  :	Tuple			      =       logging.get_logger(__name__)

_snake_case  :	str			      =       {
    "microsoft/swin-tiny-patch4-window7-224": (
        "https://huggingface.co/microsoft/swin-tiny-patch4-window7-224/resolve/main/config.json"
    ),
    # See all Swin models at https://huggingface.co/models?filter=swin
}

class        a	(_lowerCAmelCase  ,       _lowerCAmelCase   ):




							"""simple docstring"""


							__UpperCAmelCase					:							int  						=						"swin"

							__UpperCAmelCase					:							str  						=						{
							    "num_attention_heads": "num_heads",
							    "num_hidden_layers": "num_layers",
							}

							def __init__(							self :						int					,			lowerCamelCase :						Dict=224					,			lowerCamelCase :						Any=4					,			lowerCamelCase :						Dict=3					,			lowerCamelCase :						List[str]=96					,			lowerCamelCase :						Optional[Any]=[2, 2, 6, 2]					,			lowerCamelCase :						List[str]=[3, 6, 12, 24]					,			lowerCamelCase :						Optional[int]=7					,			lowerCamelCase :						List[Any]=4.0					,			lowerCamelCase :						List[Any]=True					,			lowerCamelCase :						Union[str, Any]=0.0					,			lowerCamelCase :						List[Any]=0.0					,			lowerCamelCase :						Union[str, Any]=0.1					,			lowerCamelCase :						int="gelu"					,			lowerCamelCase :						Tuple=False					,			lowerCamelCase :						Optional[int]=0.02					,			lowerCamelCase :						int=1E-5					,			lowerCamelCase :						List[str]=32					,			lowerCamelCase :						int=None					,			lowerCamelCase :						List[str]=None					,			**lowerCamelCase :						Optional[int]					,			)			->					List[str]:
														super().__init__(**lowerCamelCase       )

														__snake_case	:    Optional[Any]											=     image_size
														__snake_case	:    Tuple											=     patch_size
														__snake_case	:    int											=     num_channels
														__snake_case	:    Union[str, Any]											=     embed_dim
														__snake_case	:    Optional[Any]											=     depths
														__snake_case	:    str											=     len(lowerCamelCase       )
														__snake_case	:    List[str]											=     num_heads
														__snake_case	:    Union[str, Any]											=     window_size
														__snake_case	:    str											=     mlp_ratio
														__snake_case	:    Tuple											=     qkv_bias
														__snake_case	:    int											=     hidden_dropout_prob
														__snake_case	:    Optional[int]											=     attention_probs_dropout_prob
														__snake_case	:    Optional[Any]											=     drop_path_rate
														__snake_case	:    Tuple											=     hidden_act
														__snake_case	:    Dict											=     use_absolute_embeddings
														__snake_case	:    List[Any]											=     layer_norm_eps
														__snake_case	:    Optional[int]											=     initializer_range
														__snake_case	:    Dict											=     encoder_stride
														# we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
														# this indicates the channel dimension after the last stage of the model
														__snake_case	:    Tuple											=     int(embed_dim * 2 ** (len(lowerCamelCase       ) - 1)       )
														__snake_case	:    Optional[int]											=     ["stem"] + [F'stage{idx}' for idx in range(1					,			len(lowerCamelCase       ) + 1       )]
														__snake_case				,    __snake_case	:    List[Any]											=     get_aligned_output_features_output_indices(
														    out_features=lowerCamelCase					,			out_indices=lowerCamelCase					,			stage_names=self.stage_names       )

class        a	(_lowerCAmelCase   ):




							"""simple docstring"""


							__UpperCAmelCase					:							str  						=						version.parse("1.11"   )

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






							@property
							def 					__snake_case      (							self :						Optional[int]       )			->					float:
														return 1E-4





from maths.prime_check import is_prime







def        lowerCAmelCase_  (      __lowerCamelCase			):
							if not isinstance(__lowerCamelCase							,			__lowerCamelCase			):
														__snake_case	:    List[str]											=     F'Input value of [number={number}] must be an integer'
														raise TypeError(__lowerCamelCase			)
							if is_prime(__lowerCamelCase			) and is_prime(number + 2			):
														return number + 2
							else:
														return -1


if __name__ == "__main__":
			import doctest

			doctest.testmod()

