






"""simple docstring"""



import os
from pathlib import Path

def  _snake_case				(     )				->	int:
							from torch.utils.cpp_extension import load

							lowerCamelCase_       :							Dict									=Path(_UpperCamelCase  ).resolve().parent.parent.parent / """kernels""" / """deformable_detr"""
							lowerCamelCase_       :							Tuple									=[
							    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







"""simple docstring"""






from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
							if not (is_transformers_available() and is_torch_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from ...utils.dummy_torch_and_transformers_objects import (
							    ImageTextPipelineOutput,
							    UniDiffuserPipeline,
							)
else:
							from .modeling_text_decoder import UniDiffuserTextDecoder
							from .modeling_uvit import UniDiffuserModel, UTransformeraDModel
							from .pipeline_unidiffuser import ImageTextPipelineOutput, UniDiffuserPipeline
