

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


UpperCamelCase__  :      Union[str, Any]			=    logging.get_logger(__name__)

UpperCamelCase__  :      List[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  (    _a     , _a       ):
  __lowerCAmelCase     :	str						 =  'swin'

  __lowerCAmelCase     :	Optional[int]						 =  {
      'num_attention_heads': 'num_heads',
      'num_hidden_layers': 'num_layers',
  }

  def __init__(					self						,		_A=224						,		_A=4						,		_A=3						,		_A=96						,		_A=[2, 2, 6, 2]						,		_A=[3, 6, 12, 24]						,		_A=7						,		_A=4.0						,		_A=True						,		_A=0.0						,		_A=0.0						,		_A=0.1						,		_A="gelu"						,		_A=False						,		_A=0.0_2						,		_A=1E-5						,		_A=32						,		_A=None						,		_A=None						,		**_A						,		):
      super().__init__(**_A)

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






class       __snake_case  (    _a       ):
  __lowerCAmelCase     :	Tuple						 =  version.parse('1.11'       )

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


  @property
  def 						lowerCAmelCase__     (					self):
      return 1E-4





def 					_UpperCAmelCase       (  ):





    """simple docstring"""


    for n in range(1 ,   1_000_000       ):
        yield n * (n + 1) // 2


def 					_UpperCAmelCase       (  _SCREAMING_SNAKE_CASE					:		Tuple       ):





    """simple docstring"""


    SCREAMING_SNAKE_CASE_									=						1
    SCREAMING_SNAKE_CASE_									=						2
    while i * i <= n:
        SCREAMING_SNAKE_CASE_									=						0
        while n % i == 0:
            n //= i
            multiplicity += 1
        divisors_count *= multiplicity + 1
        i += 1
    if n > 1:
        divisors_count *= 2
    return divisors_count


def 					_UpperCAmelCase       (  ):





    """simple docstring"""


    return next(i for i in triangle_number_generator() if count_divisors(_SCREAMING_SNAKE_CASE       ) > 500       )


if __name__ == "__main__":
       print(solution())


