





from typing import TYPE_CHECKING

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


_A :   List[str]  			=  {"""configuration_vit""": ["""VIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ViTConfig""", """ViTOnnxConfig"""]}

try:
       if not is_vision_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _A :   List[Any]  			=  ["""ViTFeatureExtractor"""]
       _A :   List[str]  			=  ["""ViTImageProcessor"""]

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _A :   str  			=  [
           """VIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """ViTForImageClassification""",
           """ViTForMaskedImageModeling""",
           """ViTModel""",
           """ViTPreTrainedModel""",
       ]

try:
       if not is_tf_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _A :   Any  			=  [
           """TFViTForImageClassification""",
           """TFViTModel""",
           """TFViTPreTrainedModel""",
       ]

try:
       if not is_flax_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       _A :   Dict  			=  [
           """FlaxViTForImageClassification""",
           """FlaxViTModel""",
           """FlaxViTPreTrainedModel""",
       ]

if TYPE_CHECKING:
       from .configuration_vit import VIT_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTConfig, ViTOnnxConfig

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .feature_extraction_vit import ViTFeatureExtractor
              from .image_processing_vit import ViTImageProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_vit import (
                  VIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  ViTForImageClassification,
                  ViTForMaskedImageModeling,
                  ViTModel,
                  ViTPreTrainedModel,
              )

       try:
              if not is_tf_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_tf_vit import TFViTForImageClassification, TFViTModel, TFViTPreTrainedModel

       try:
              if not is_flax_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_flax_vit import FlaxViTForImageClassification, FlaxViTModel, FlaxViTPreTrainedModel


else:
       import sys

       _A :   List[str]  			=  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)










import os
from pathlib import Path



def 	_a						(   )    ->    Tuple:







   """simple docstring"""
   from torch.utils.cpp_extension import load

   lowerCamelCase__       :						List[Any]        =							Path(UpperCAmelCase					).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr'''
   lowerCamelCase__       :						Any        =							[
       root / filename
       for filename in [
           '''vision.cpp''',
           os.path.join('''cpu'''      ,  '''ms_deform_attn_cpu.cpp'''					),
           os.path.join('''cuda'''      ,  '''ms_deform_attn_cuda.cu'''					),
       ]
   ]

   load(
       '''MultiScaleDeformableAttention'''      ,  UpperCAmelCase      ,  with_cuda=UpperCAmelCase      ,  extra_include_paths=[str(UpperCAmelCase					)]      ,  extra_cflags=['''-DWITH_CUDA=1''']      ,  extra_cuda_cflags=[
           '''-DCUDA_HAS_FP16=1''',
           '''-D__CUDA_NO_HALF_OPERATORS__''',
           '''-D__CUDA_NO_HALF_CONVERSIONS__''',
           '''-D__CUDA_NO_HALF2_OPERATORS__''',
       ]      ,  )

   import MultiScaleDeformableAttention as MSDA

   return MSDA



