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


lowercase_     :   List[Any] 				=				logging.get_logger(__name__)

lowercase_     :   Optional[int] 				=				{
    '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 		_lowerCamelCase		(   UpperCamelCase_    ):
    __a  =      "visual_bert"
    def __init__(  self , lowerCAmelCase=30522 , lowerCAmelCase=768 , lowerCAmelCase=512 , lowerCAmelCase=12 , lowerCAmelCase=12 , lowerCAmelCase=3072 , lowerCAmelCase="gelu" , lowerCAmelCase=0.1 , lowerCAmelCase=0.1 , lowerCAmelCase=512 , lowerCAmelCase=2 , lowerCAmelCase=0.02 , lowerCAmelCase=1e-12 , lowerCAmelCase=False , lowerCAmelCase=True , lowerCAmelCase=1 , lowerCAmelCase=0 , lowerCAmelCase=2 , **lowerCAmelCase , )       ->					List[str]:
     super().__init__(pad_token_id=lowerCAmelCase , bos_token_id=lowerCAmelCase , eos_token_id=lowerCAmelCase , **lowerCAmelCase   )

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


# Lint as: python3
import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


lowercase_     :   str 				=				re.compile(R'^(?P<major>\d+)' R'\.(?P<minor>\d+)' R'\.(?P<patch>\d+)$')






@total_ordering
@dataclass
class 		_lowerCamelCase		:
    __a  =      42
    __a  =      None
    __a  =      None
    __a  =      None
    __a  =      None
    def 						UpperCamelCase_				(  self   )       ->					str:
     SCREAMING_SNAKE_CASE__,	SCREAMING_SNAKE_CASE__,	SCREAMING_SNAKE_CASE__:   int=      _str_to_version_tuple(self.version_str   )
    def __repr__(  self   )       ->					Dict:
     return f'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'
    @property
    def 						UpperCamelCase_				(  self   )       ->					List[str]:
     return self.major, self.minor, self.patch
    def 						UpperCamelCase_				(  self , lowerCAmelCase   )       ->					Dict:
     if isinstance(lowerCAmelCase , lowerCAmelCase   ):
      return Version(lowerCAmelCase   )
     elif isinstance(lowerCAmelCase , lowerCAmelCase   ):
      return other
     raise TypeError(f'{other} (type {type(lowerCAmelCase   )}) cannot be compared to version.'   )
    def __eq__(  self , lowerCAmelCase   )       ->					Optional[int]:
     try:
      SCREAMING_SNAKE_CASE__:   List[str]=      self._validate_operand(lowerCAmelCase   )
     except (TypeError, ValueError):
      return False
     else:
      return self.tuple == other.tuple
    def __lt__(  self , lowerCAmelCase   )       ->					List[str]:
     SCREAMING_SNAKE_CASE__:   Optional[Any]=      self._validate_operand(lowerCAmelCase   )
     return self.tuple < other.tuple
    def __hash__(  self   )       ->					List[Any]:
     return hash(_version_tuple_to_str(self.tuple   )   )
    @classmethod
    def 						UpperCamelCase_				(  cls , lowerCAmelCase   )       ->					Tuple:
     SCREAMING_SNAKE_CASE__:   Dict=      {f.name for f in dataclasses.fields(cls   )}
     return cls(**{k: v for k, v in dic.items() if k in field_names}   )



    def 						UpperCamelCase_				(  self   )       ->					str:
     return self.version_str







def 			A__      (	snake_case_ :		int      ):
 SCREAMING_SNAKE_CASE__:   List[Any]=      _VERSION_REG.match(snake_case_      )
 if not res:
  raise ValueError(F'Invalid version \'{version_str}\'. Format should be x.y.z with {{x,y,z}} being digits.'      )
 return tuple(int(snake_case_      ) for v in [res.group('''major'''      ), res.group('''minor'''      ), res.group('''patch'''      )]      )







def 			A__      (	snake_case_ :		Union[str, Any]      ):
 return ".".join(str(snake_case_      ) for v in version_tuple      )

