

'''simple docstring'''

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


lowercase__            =     logging.get_logger(__name__)

lowercase__            =     {
    "dandelin/vilt-b32-mlm": "https://huggingface.co/dandelin/vilt-b32-mlm/blob/main/config.json"
}




class 			A_					(							_snake_case				):






     '''simple docstring'''



     UpperCAmelCase_		:      Union[str, Any]    						=    """vilt"""


     def __init__(						self					:	str	,     lowercase_					:	Union[str, Any]=30_522	,     lowercase_					:	Union[str, Any]=2	,     lowercase_					:	str=2	,     lowercase_					:	int=40	,     lowercase_					:	List[Any]=768	,     lowercase_					:	Dict=12	,     lowercase_					:	Dict=12	,     lowercase_					:	Any=3_072	,     lowercase_					:	Union[str, Any]="gelu"	,     lowercase_					:	int=0.0	,     lowercase_					:	Optional[Any]=0.0	,     lowercase_					:	Union[str, Any]=0.02	,     lowercase_					:	int=1E-12	,     lowercase_					:	List[str]=384	,     lowercase_					:	Any=32	,     lowercase_					:	Any=3	,     lowercase_					:	List[Any]=True	,     lowercase_					:	str=-1	,     lowercase_					:	Dict=False	,     lowercase_					:	Union[str, Any]=-1	,     **lowercase_					:	Dict	,     )		->      Any:
      super().__init__(tie_word_embeddings=lowercase_	,     **lowercase_			)

      UpperCAmelCase			:      Optional[Any]		   =					vocab_size
      UpperCAmelCase			:      Any		   =					type_vocab_size
      UpperCAmelCase			:      Tuple		   =					modality_type_vocab_size
      UpperCAmelCase			:      Any		   =					max_position_embeddings

      UpperCAmelCase			:      Optional[Any]		   =					hidden_size
      UpperCAmelCase			:      Dict		   =					num_hidden_layers
      UpperCAmelCase			:      List[str]		   =					num_attention_heads
      UpperCAmelCase			:      Dict		   =					intermediate_size
      UpperCAmelCase			:      int		   =					hidden_act
      UpperCAmelCase			:      str		   =					hidden_dropout_prob
      UpperCAmelCase			:      Any		   =					attention_probs_dropout_prob
      UpperCAmelCase			:      Optional[Any]		   =					initializer_range
      UpperCAmelCase			:      str		   =					layer_norm_eps

      UpperCAmelCase			:      List[Any]		   =					image_size
      UpperCAmelCase			:      int		   =					patch_size
      UpperCAmelCase			:      Tuple		   =					num_channels
      UpperCAmelCase			:      Dict		   =					qkv_bias
      UpperCAmelCase			:      Dict		   =					max_image_length
      UpperCAmelCase			:      Optional[Any]		   =					num_images







'''simple docstring'''

from __future__ import annotations




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_    ,			UpperCAmelCase_      ):
 assert n > 1 and a > 0 and greatest_common_divisor(UpperCAmelCase_    ,			UpperCAmelCase_      ) == 1
 ((UpperCAmelCase)   ,					(UpperCAmelCase)   ,					(UpperCAmelCase))			:      Dict		   =					extended_gcd(UpperCAmelCase_    ,			UpperCAmelCase_      )  # Implemented below
 UpperCAmelCase			:      int		   =					(b * s) % n
 return x




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_      ):
 ((UpperCAmelCase)   ,					(UpperCAmelCase))			:      int		   =					extended_euclid(UpperCAmelCase_    ,			UpperCAmelCase_      )  # Implemented below
 if b < 0:
  UpperCAmelCase			:      Optional[int]		   =					(b % n + n) % n
 return b




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_    ,			UpperCAmelCase_      ):
 UpperCAmelCase			:      Tuple		   =					invert_modulo(UpperCAmelCase_    ,			UpperCAmelCase_      )
 UpperCAmelCase			:      List[Any]		   =					(b * s) % n
 return x




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_      ):
 assert a >= 0 and b >= 0

 if b == 0:
  UpperCAmelCase   ,					UpperCAmelCase   ,					UpperCAmelCase			:      Dict		   =					a, 1, 0
 else:
  ((UpperCAmelCase)   ,					(UpperCAmelCase)   ,					(UpperCAmelCase))			:      Optional[int]		   =					extended_gcd(UpperCAmelCase_    ,			a % b      )
  UpperCAmelCase			:      Dict		   =					q
  UpperCAmelCase			:      int		   =					p - q * (a // b)

 assert a % d == 0 and b % d == 0
 assert d == a * x + b * y

 return (d, x, y)




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_      ):
 if b == 0:
  return (1, 0)
 ((UpperCAmelCase)   ,					(UpperCAmelCase))			:      Tuple		   =					extended_euclid(UpperCAmelCase_    ,			a % b      )
 UpperCAmelCase			:      Tuple		   =					a // b
 return (y, x - k * y)




def  UpperCamelCase(	UpperCAmelCase_    ,			UpperCAmelCase_      ):
 if a < b:
  UpperCAmelCase   ,					UpperCAmelCase			:      Union[str, Any]		   =					b, a

 while a % b != 0:
  UpperCAmelCase   ,					UpperCAmelCase			:      int		   =					b, a % b

 return b


if __name__ == "__main__":
 from doctest import testmod

 testmod(name="modular_division", verbose=True)
 testmod(name="modular_division2", verbose=True)
 testmod(name="invert_modulo", verbose=True)
 testmod(name="extended_gcd", verbose=True)
 testmod(name="extended_euclid", verbose=True)
 testmod(name="greatest_common_divisor", verbose=True)




