



"""simple docstring"""







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


lowercase__		:				int          =	logging.get_logger(__name__)

lowercase__		:				Tuple          =	{
    "uclanlp/visualbert-vqa": "https://huggingface.co/uclanlp/visualbert-vqa/resolve/main/config.json",
    "uclanlp/visualbert-vqa-pre": "https://huggingface.co/uclanlp/visualbert-vqa-pre/resolve/main/config.json",
    "uclanlp/visualbert-vqa-coco-pre": (
        "https://huggingface.co/uclanlp/visualbert-vqa-coco-pre/resolve/main/config.json"
    ),
    "uclanlp/visualbert-vcr": "https://huggingface.co/uclanlp/visualbert-vcr/resolve/main/config.json",
    "uclanlp/visualbert-vcr-pre": "https://huggingface.co/uclanlp/visualbert-vcr-pre/resolve/main/config.json",
    "uclanlp/visualbert-vcr-coco-pre": (
        "https://huggingface.co/uclanlp/visualbert-vcr-coco-pre/resolve/main/config.json"
    ),
    "uclanlp/visualbert-nlvr2": "https://huggingface.co/uclanlp/visualbert-nlvr2/resolve/main/config.json",
    "uclanlp/visualbert-nlvr2-pre": "https://huggingface.co/uclanlp/visualbert-nlvr2-pre/resolve/main/config.json",
    "uclanlp/visualbert-nlvr2-coco-pre": (
        "https://huggingface.co/uclanlp/visualbert-nlvr2-coco-pre/resolve/main/config.json"
    )
    # See all VisualBERT models at https://huggingface.co/models?filter=visual_bert
}







class       UpperCamelCase__   (	lowerCAmelCase_  ):




      """simple docstring"""




      _SCREAMING_SNAKE_CASE  				=     """visual_bert"""



      def __init__(      self				:      int    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=3_0_5_2_2    ,			SCREAMING_SNAKE_CASE_				:      int=7_6_8    ,			SCREAMING_SNAKE_CASE_				:      int=5_1_2    ,			SCREAMING_SNAKE_CASE_				:      Any=1_2    ,			SCREAMING_SNAKE_CASE_				:      Tuple=1_2    ,			SCREAMING_SNAKE_CASE_				:      int=3_0_7_2    ,			SCREAMING_SNAKE_CASE_				:      Any="gelu"    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=0.1    ,			SCREAMING_SNAKE_CASE_				:      Any=0.1    ,			SCREAMING_SNAKE_CASE_				:      Dict=5_1_2    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=2    ,			SCREAMING_SNAKE_CASE_				:      Any=0.02    ,			SCREAMING_SNAKE_CASE_				:      List[Any]=1E-12    ,			SCREAMING_SNAKE_CASE_				:      List[str]=False    ,			SCREAMING_SNAKE_CASE_				:      Tuple=True    ,			SCREAMING_SNAKE_CASE_				:      Optional[int]=1    ,			SCREAMING_SNAKE_CASE_				:      Optional[Any]=0    ,			SCREAMING_SNAKE_CASE_				:      Union[str, Any]=2    ,			**SCREAMING_SNAKE_CASE_				:      List[Any]    ,			):
        super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_    ,			bos_token_id=SCREAMING_SNAKE_CASE_    ,			eos_token_id=SCREAMING_SNAKE_CASE_    ,			**SCREAMING_SNAKE_CASE_       )

        lowerCAmelCase_   :				Dict								= vocab_size
        lowerCAmelCase_   :				Tuple								= max_position_embeddings
        lowerCAmelCase_   :				Dict								= hidden_size
        lowerCAmelCase_   :				Dict								= visual_embedding_dim
        lowerCAmelCase_   :				Union[str, Any]								= num_hidden_layers
        lowerCAmelCase_   :				Optional[int]								= num_attention_heads
        lowerCAmelCase_   :				Optional[int]								= intermediate_size
        lowerCAmelCase_   :				str								= hidden_act
        lowerCAmelCase_   :				List[Any]								= hidden_dropout_prob
        lowerCAmelCase_   :				Optional[Any]								= attention_probs_dropout_prob
        lowerCAmelCase_   :				Optional[Any]								= initializer_range
        lowerCAmelCase_   :				Any								= type_vocab_size
        lowerCAmelCase_   :				Dict								= layer_norm_eps
        lowerCAmelCase_   :				Tuple								= bypass_transformer
        lowerCAmelCase_   :				List[Any]								= special_visual_initialize










"""simple docstring"""






from __future__ import annotations






def      snake_case__   (		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int	):
			"""simple docstring"""
			if b == 0:
						return (1, 0)
			((lowerCamelCase__)	,   (lowerCamelCase__))		:		Any			=extended_euclid(__lowerCamelCase							,		a % b	)
			lowerCamelCase__		:		Optional[Any]			=a // b
			return (y, x - k * y)






def      snake_case__   (		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int	):
			"""simple docstring"""
			((lowerCamelCase__)	,   (lowerCamelCase__))		:		Any			=extended_euclid(__lowerCamelCase							,		__lowerCamelCase	)
			lowerCamelCase__		:		List[Any]			=na * na
			lowerCamelCase__		:		Union[str, Any]			=ra * x * na + ra * y * na
			return (n % m + m) % m






def      snake_case__   (		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int	):
			"""simple docstring"""
			((lowerCamelCase__)	,   (lowerCamelCase__))		:		int			=extended_euclid(__lowerCamelCase							,		__lowerCamelCase	)
			if b < 0:
						lowerCamelCase__		:		Any			=(b % n + n) % n
			return b






def      snake_case__   (		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int	):
			"""simple docstring"""
			lowerCamelCase__	,   lowerCamelCase__		:		Any			=invert_modulo(__lowerCamelCase							,		__lowerCamelCase	), invert_modulo(__lowerCamelCase							,		__lowerCamelCase	)
			lowerCamelCase__		:		Tuple			=na * na
			lowerCamelCase__		:		Optional[Any]			=ra * x * na + ra * y * na
			return (n % m + m) % m


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

		testmod(name="chinese_remainder_theorem", verbose=True)
		testmod(name="chinese_remainder_theorem2", verbose=True)
		testmod(name="invert_modulo", verbose=True)
		testmod(name="extended_euclid", verbose=True)




