
'''simple docstring'''





import copy
from typing import Dict

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING
from ..bit import BitConfig


SCREAMING_SNAKE_CASE    =					logging.get_logger(__name__)

SCREAMING_SNAKE_CASE    =					{
    """google/vit-hybrid-base-bit-384""": """https://huggingface.co/vit-hybrid-base-bit-384/resolve/main/config.json""",
    # See all ViT hybrid models at https://huggingface.co/models?filter=vit
}






class        UpperCAmelCase_       (						A							):

 '''simple docstring'''
 lowercase_				:						List[str]				=       "vit-hybrid"







 def __init__(				self		:     str ,							snake_case__		:     str=None ,							snake_case__		:     Optional[int]=7_68 ,							snake_case__		:     Tuple=12 ,							snake_case__		:     List[str]=12 ,							snake_case__		:     int=30_72 ,							snake_case__		:     Dict="gelu" ,							snake_case__		:     Optional[Any]=0.0 ,							snake_case__		:     List[Any]=0.0 ,							snake_case__		:     int=0.02 ,							snake_case__		:     List[str]=1e-12 ,							snake_case__		:     List[Any]=2_24 ,							snake_case__		:     Optional[int]=1 ,							snake_case__		:     Optional[int]=3 ,							snake_case__		:     int=[1, 10_24, 24, 24] ,							snake_case__		:     Any=True ,							**snake_case__		:     int ,							):



   '''simple docstring'''




   super().__init__(**snake_case__   )

   if backbone_config is None:
     logger.info("`backbone_config` is `None`. Initializing the config with a `BiT` backbone."   )
     UpperCAmelCase__			:				Any												=       {
         "global_padding": "same",
         "layer_type": "bottleneck",
         "depths": [3, 4, 9],
         "out_features": ["stage3"],
         "embedding_dynamic_padding": True,
     }

   if isinstance(snake_case__ ,							snake_case__   ):
     if "model_type" in backbone_config:
       UpperCAmelCase__			:				Any												=       CONFIG_MAPPING[backbone_config["model_type"]]
     else:
       logger.info(
           "`model_type` is not found in `backbone_config`. Use `Bit` as the backbone configuration class."   )
       UpperCAmelCase__			:				Any												=       BitConfig
     UpperCAmelCase__			:				Tuple												=       backbone_config_class(**snake_case__   )

   UpperCAmelCase__			:				Optional[int]												=       backbone_featmap_shape
   UpperCAmelCase__			:				Union[str, Any]												=       backbone_config
   UpperCAmelCase__			:				Dict												=       hidden_size
   UpperCAmelCase__			:				List[str]												=       num_hidden_layers
   UpperCAmelCase__			:				List[Any]												=       num_attention_heads
   UpperCAmelCase__			:				Tuple												=       intermediate_size
   UpperCAmelCase__			:				List[str]												=       hidden_act
   UpperCAmelCase__			:				Union[str, Any]												=       hidden_dropout_prob
   UpperCAmelCase__			:				Tuple												=       attention_probs_dropout_prob
   UpperCAmelCase__			:				Tuple												=       initializer_range
   UpperCAmelCase__			:				Optional[Any]												=       layer_norm_eps
   UpperCAmelCase__			:				int												=       image_size
   UpperCAmelCase__			:				int												=       patch_size
   UpperCAmelCase__			:				Optional[int]												=       num_channels
   UpperCAmelCase__			:				Any												=       qkv_bias







 def        UpperCamelCase     (				self		:     Union[str, Any]   ):



   '''simple docstring'''




   UpperCAmelCase__			:				Tuple												=       copy.deepcopy(self.__dict__   )
   UpperCAmelCase__			:				Dict												=       self.backbone_config.to_dict()
   UpperCAmelCase__			:				Union[str, Any]												=       self.__class__.model_type
   return output





'''simple docstring'''





from doctest import testmod
from math import sqrt







def snake_case_    (				lowercase__		):
  UpperCAmelCase__			:				list[int]												=       []
  if num < 1:
    return facs
  facs.append(1		)
  if num == 1:
    return facs
  facs.append(lowercase__		)
  for i in range(2      ,					int(sqrt(lowercase__		)		) + 1		):
    if num % i == 0:  # If i is a factor of num
      facs.append(lowercase__		)
      UpperCAmelCase__			:				Tuple												=       num // i  # num//i is the other factor of num
      if d != i:  # If d and i are distinct
        facs.append(lowercase__		)  # we have found another factor
  facs.sort()
  return facs


if __name__ == "__main__":
      testmod(name="""factors_of_a_number""", verbose=True)



