






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


__magic_name__:					Optional[int]							=     logging.get_logger(__name__)

__magic_name__:					Optional[Any]							=     {
    "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 	snake_case__ (							_lowerCAmelCase						,  _lowerCAmelCase				):
	lowercase__						:					int											=   '''swin'''

	lowercase__						:					Optional[Any]											=   {
	    '''num_attention_heads''': '''num_heads''',
	    '''num_hidden_layers''': '''num_layers''',
	}
	def __init__(    self      ,       lowerCAmelCase__=2_24      ,       lowerCAmelCase__=4      ,       lowerCAmelCase__=3      ,       lowerCAmelCase__=96      ,       lowerCAmelCase__=[2, 2, 6, 2]      ,       lowerCAmelCase__=[3, 6, 12, 24]      ,       lowerCAmelCase__=7      ,       lowerCAmelCase__=4.0      ,       lowerCAmelCase__=True      ,       lowerCAmelCase__=0.0      ,       lowerCAmelCase__=0.0      ,       lowerCAmelCase__=0.1      ,       lowerCAmelCase__="gelu"      ,       lowerCAmelCase__=False      ,       lowerCAmelCase__=0.0_2      ,       lowerCAmelCase__=1e-5      ,       lowerCAmelCase__=32      ,       lowerCAmelCase__=None      ,       lowerCAmelCase__=None      ,       **lowerCAmelCase__      ,       )							->				Optional[int]:
							super().__init__(**lowerCAmelCase__			)

							__magic_name__      :       Tuple       						= image_size
							__magic_name__      :       Any       						= patch_size
							__magic_name__      :       Dict       						= num_channels
							__magic_name__      :       List[str]       						= embed_dim
							__magic_name__      :       str       						= depths
							__magic_name__      :       Tuple       						= len(lowerCAmelCase__			)
							__magic_name__      :       Tuple       						= num_heads
							__magic_name__      :       Tuple       						= window_size
							__magic_name__      :       Any       						= mlp_ratio
							__magic_name__      :       List[Any]       						= qkv_bias
							__magic_name__      :       List[Any]       						= hidden_dropout_prob
							__magic_name__      :       str       						= attention_probs_dropout_prob
							__magic_name__      :       List[Any]       						= drop_path_rate
							__magic_name__      :       Tuple       						= hidden_act
							__magic_name__      :       Optional[int]       						= use_absolute_embeddings
							__magic_name__      :       Optional[Any]       						= layer_norm_eps
							__magic_name__      :       Optional[Any]       						= initializer_range
							__magic_name__      :       List[Any]       						= 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
							__magic_name__      :       Optional[int]       						= int(embed_dim * 2 ** (len(lowerCAmelCase__			) - 1)			)
							__magic_name__      :       List[str]       						= ["""stem"""] + [F'stage{idx}' for idx in range(1      ,       len(lowerCAmelCase__			) + 1			)]
							__magic_name__						,__magic_name__      :       Optional[int]       						= get_aligned_output_features_output_indices(
							    out_features=lowerCAmelCase__      ,       out_indices=lowerCAmelCase__      ,       stage_names=self.stage_names			)





class 	snake_case__ (							_lowerCAmelCase				):
	lowercase__						:					List[str]											=   version.parse('''1.11'''				)
	@property
	def       __magic_name__    (    self			)							->				Mapping[str, Mapping[int, str]]:
							return OrderedDict(
							    [
							        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
							    ]			)







	@property
	def       __magic_name__    (    self			)							->				float:
							return 1e-4








__magic_name__:					List[Any]							=     "\n# Transformers 설치 방법\n! pip install transformers datasets\n# 마지막 릴리스 대신 소스에서 설치하려면, 위 명령을 주석으로 바꾸고 아래 명령을 해제하세요.\n# ! pip install git+https://github.com/huggingface/transformers.git\n"

__magic_name__:					Dict							=     [{"type": "code", "content": INSTALL_CONTENT}]
__magic_name__:					Optional[Any]							=     {
    "{processor_class}": "FakeProcessorClass",
    "{model_class}": "FakeModelClass",
    "{object_class}": "FakeObjectClass",
}
