


'''simple docstring'''







from ...configuration_utils import PretrainedConfig
from ...utils import logging


A__:       List[str]          =			logging.get_logger(__name__)

A__:       Optional[int]          =			{
    '''naver-clova-ix/donut-base''': '''https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json''',
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}







class A__			(		UpperCAmelCase__ ):
      __UpperCamelCase			:    Union[str, Any]      			=				"donut-swin"

      __UpperCamelCase			:    int      			=				{
          "num_attention_heads": "num_heads",
          "num_hidden_layers": "num_layers",
      }






      def __init__(					self     :Tuple	,		SCREAMING_SNAKE_CASE     :Tuple=2_2_4	,		SCREAMING_SNAKE_CASE     :Union[str, Any]=4	,		SCREAMING_SNAKE_CASE     :Optional[Any]=3	,		SCREAMING_SNAKE_CASE     :Union[str, Any]=9_6	,		SCREAMING_SNAKE_CASE     :Optional[Any]=[2, 2, 6, 2]	,		SCREAMING_SNAKE_CASE     :Tuple=[3, 6, 1_2, 2_4]	,		SCREAMING_SNAKE_CASE     :Tuple=7	,		SCREAMING_SNAKE_CASE     :Any=4.0	,		SCREAMING_SNAKE_CASE     :int=True	,		SCREAMING_SNAKE_CASE     :Dict=0.0	,		SCREAMING_SNAKE_CASE     :str=0.0	,		SCREAMING_SNAKE_CASE     :Dict=0.1	,		SCREAMING_SNAKE_CASE     :List[str]="gelu"	,		SCREAMING_SNAKE_CASE     :List[Any]=False	,		SCREAMING_SNAKE_CASE     :Optional[int]=0.02	,		SCREAMING_SNAKE_CASE     :Union[str, Any]=1e-5	,		**SCREAMING_SNAKE_CASE     :Optional[Any]	,		)			->   Optional[Any]:




             '''simple docstring'''
             super().__init__(**_lowerCAmelCase      )

             _a       :					List[str]	   =image_size
             _a       :					str	   =patch_size
             _a       :					int	   =num_channels
             _a       :					Optional[Any]	   =embed_dim
             _a       :					Dict	   =depths
             _a       :					List[Any]	   =len(_lowerCAmelCase      )
             _a       :					Optional[Any]	   =num_heads
             _a       :					Union[str, Any]	   =window_size
             _a       :					Optional[Any]	   =mlp_ratio
             _a       :					Dict	   =qkv_bias
             _a       :					Optional[int]	   =hidden_dropout_prob
             _a       :					Any	   =attention_probs_dropout_prob
             _a       :					List[Any]	   =drop_path_rate
             _a       :					Optional[Any]	   =hidden_act
             _a       :					Optional[int]	   =use_absolute_embeddings
             _a       :					Optional[Any]	   =layer_norm_eps
             _a       :					List[str]	   =initializer_range
             # 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
             _a       :					str	   =int(embed_dim * 2 ** (len(_lowerCAmelCase      ) - 1)      )









'''simple docstring'''


from ...configuration_utils import PretrainedConfig
from ...utils import logging


_SCREAMING_SNAKE_CASE									=				logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE									=				{
    "microsoft/swinv2-tiny-patch4-window8-256": (
        "https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json"
    ),
}

class  lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase    :				Union[str, Any]								=       "swinv2"

 __lowerCamelCase    :				int								=       {
     "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      ,  )     ->				Tuple:
     super().__init__(**_lowerCAmelCase		)

     _lowerCAmelCase						      =   image_size
     _lowerCAmelCase						      =   patch_size
     _lowerCAmelCase						      =   num_channels
     _lowerCAmelCase						      =   embed_dim
     _lowerCAmelCase						      =   depths
     _lowerCAmelCase						      =   len(_lowerCAmelCase		)
     _lowerCAmelCase						      =   num_heads
     _lowerCAmelCase						      =   window_size
     _lowerCAmelCase						      =   mlp_ratio
     _lowerCAmelCase						      =   qkv_bias
     _lowerCAmelCase						      =   hidden_dropout_prob
     _lowerCAmelCase						      =   attention_probs_dropout_prob
     _lowerCAmelCase						      =   drop_path_rate
     _lowerCAmelCase						      =   hidden_act
     _lowerCAmelCase						      =   use_absolute_embeddings
     _lowerCAmelCase						      =   layer_norm_eps
     _lowerCAmelCase						      =   initializer_range
     _lowerCAmelCase						      =   encoder_stride
     # we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
     # this indicates the channel dimension after the last stage of the model
     _lowerCAmelCase						      =   int(embed_dim * 2 ** (len(_lowerCAmelCase		) - 1)		)
     _lowerCAmelCase						      =   (0, 0, 0, 0)


