


import os
from pathlib import Path



def  _a			(						):
     from torch.utils.cpp_extension import load

     a_    :     Union[str, Any]										=    Path(__UpperCamelCase ).resolve().parent.parent.parent / """kernels""" / """deformable_detr"""
     a_    :     Dict										=    [
         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







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__lowerCamelCase        =     {
    '''configuration_altclip''': [
        '''ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''AltCLIPConfig''',
        '''AltCLIPTextConfig''',
        '''AltCLIPVisionConfig''',
    ],
    '''processing_altclip''': ['''AltCLIPProcessor'''],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __lowerCamelCase        =     [
           '''ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''AltCLIPPreTrainedModel''',
           '''AltCLIPModel''',
           '''AltCLIPTextModel''',
           '''AltCLIPVisionModel''',
       ]


if TYPE_CHECKING:
       from .configuration_altclip import (
           ALTCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
           AltCLIPConfig,
           AltCLIPTextConfig,
           AltCLIPVisionConfig,
       )
       from .processing_altclip import AltCLIPProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_altclip import (
                  ALTCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                  AltCLIPModel,
                  AltCLIPPreTrainedModel,
                  AltCLIPTextModel,
                  AltCLIPVisionModel,
              )


else:
       import sys

       __lowerCamelCase        =     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



