





'''simple docstring'''

import os
from pathlib import Path




def    _a    (							):





      """simple docstring"""



      from torch.utils.cpp_extension import load

      _snake_case		:	Tuple					     =     Path(lowerCAmelCase_	).resolve().parent.parent.parent / '''kernels''' / '''deformable_detr'''
      _snake_case		:	Optional[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'''			,      lowerCAmelCase_			,      with_cuda=lowerCAmelCase_			,      extra_include_paths=[str(lowerCAmelCase_	)]			,      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'''

import math

from numpy import inf
from scipy.integrate import quad




def    _a    (							lowerCAmelCase_	):





      """simple docstring"""



      if num <= 0:
            raise ValueError('''math domain error'''	)

      return quad(lowerCAmelCase_			,      0			,      lowerCAmelCase_			,      args=(lowerCAmelCase_)	)[0]




def    _a    (							lowerCAmelCase_			,      lowerCAmelCase_	):





      """simple docstring"""



      return math.pow(lowerCAmelCase_			,      z - 1	) * math.exp(-x	)


if __name__ == "__main__":
   from doctest import testmod

   testmod()


