

'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


lowercase__         =      {"configuration_vit_mae": ["VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP", "ViTMAEConfig"]}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase__         =      [
     "VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST",
     "ViTMAEForPreTraining",
     "ViTMAELayer",
     "ViTMAEModel",
     "ViTMAEPreTrainedModel",
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase__         =      [
     "TFViTMAEForPreTraining",
     "TFViTMAEModel",
     "TFViTMAEPreTrainedModel",
 ]

if TYPE_CHECKING:
 from .configuration_vit_mae import VIT_MAE_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMAEConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_vit_mae import (
      VIT_MAE_PRETRAINED_MODEL_ARCHIVE_LIST,
      ViTMAEForPreTraining,
      ViTMAELayer,
      ViTMAEModel,
      ViTMAEPreTrainedModel,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_vit_mae import TFViTMAEForPreTraining, TFViTMAEModel, TFViTMAEPreTrainedModel


else:
 import sys

 lowercase__         =      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)







'''simple docstring'''

def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
 while a != 0:
  UpperCAmelCase ,			UpperCAmelCase	:     Tuple						 =			b % a, a
 return b




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_     ):
 if gcd(UpperCAmelCase_  ,	UpperCAmelCase_     ) != 1:
  UpperCAmelCase	:     List[str]						 =			F"""mod inverse of {a!r} and {m!r} does not exist"""
  raise ValueError(UpperCAmelCase_     )
 UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase	:     Any						 =			1, 0, a
 UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase	:     Dict						 =			0, 1, m
 while va != 0:
  UpperCAmelCase	:     Tuple						 =			ua // va
  UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase ,			UpperCAmelCase	:     List[Any]						 =			(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
 return ua % m




