

'''simple docstring'''
import os
from pathlib import Path




def 	UpperCamelCase   (       )		->	Any:




  '''simple docstring'''



  from torch.utils.cpp_extension import load

  lowercase									=Path(lowercase_	).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr'''
  lowercase									=[
      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'''     ,					lowercase_     ,					with_cuda=lowercase_     ,					extra_include_paths=[str(lowercase_	)]     ,					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'''



def   lowercase__(			__UpperCamelCase:					int    ):

      """simple docstring"""






      if not isinstance(__UpperCamelCase      ,__UpperCamelCase    ):
            raise TypeError('Input value must be an \'int\' type'    )

      SCREAMING_SNAKE_CASE   :      int    					=						0
      while number:
            position += 1
            number >>= 1

      return position


if __name__ == "__main__":
      import doctest

      doctest.testmod()


