





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


__magic_name__   :						Any    =			logging.get_logger(__name__)

__magic_name__   :						Optional[int]    =			{
    """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       __SCREAMING_SNAKE_CASE	(						__UpperCamelCase					,    __UpperCamelCase			):



     '''simple docstring'''






     UpperCAmelCase__       :						Union[str, Any]      =   '''swin'''

     UpperCAmelCase__       :						Union[str, Any]      =   {
         '''num_attention_heads''': '''num_heads''',
         '''num_hidden_layers''': '''num_layers''',
     }

     def __init__(					self						,   lowerCamelCase=224						,   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.02						,   lowerCamelCase=1e-5						,   lowerCamelCase=32						,   lowerCamelCase=None						,   lowerCamelCase=None						,   **lowerCamelCase						,   ):
       super().__init__(**lowerCamelCase	)

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







class       __SCREAMING_SNAKE_CASE	(						__UpperCamelCase			):



     '''simple docstring'''






     UpperCAmelCase__       :						Dict      =   version.parse('''1.11'''			)

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






     @property
     def 	UpperCamelCase(					self	):
       return 1e-4









'''simple docstring'''



from typing import TYPE_CHECKING

from ...file_utils import _LazyModule, is_torch_available
from ...utils import OptionalDependencyNotAvailable


__magic_name__   :						Any    =			{
    """configuration_gpt_neox_japanese""": ["""GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTNeoXJapaneseConfig"""],
    """tokenization_gpt_neox_japanese""": ["""GPTNeoXJapaneseTokenizer"""],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __magic_name__   :						List[Any]    =			[
     """GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """GPTNeoXJapaneseForCausalLM""",
     """GPTNeoXJapaneseLayer""",
     """GPTNeoXJapaneseModel""",
     """GPTNeoXJapanesePreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_gpt_neox_japanese import GPT_NEOX_JAPANESE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoXJapaneseConfig
 from .tokenization_gpt_neox_japanese import GPTNeoXJapaneseTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_gpt_neox_japanese import (
      GPT_NEOX_JAPANESE_PRETRAINED_MODEL_ARCHIVE_LIST,
      GPTNeoXJapaneseForCausalLM,
      GPTNeoXJapaneseLayer,
      GPTNeoXJapaneseModel,
      GPTNeoXJapanesePreTrainedModel,
  )


else:
 import sys

 __magic_name__   :						Union[str, Any]    =			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


