





from ...configuration_utils import PretrainedConfig
from ...utils import logging


_A :   Any  			=  logging.get_logger(__name__)

_A :   int  			=  {
    'facebook/timesformer': 'https://huggingface.co/facebook/timesformer/resolve/main/config.json',
}


class        __SCREAMING_SNAKE_CASE      (			lowerCAmelCase_ ):
       _UpperCAmelCase				:  Dict      =   "timesformer"







       def __init__(				self					:     List[str]		, A					:     int=2_2_4		, A					:     Optional[Any]=1_6		, A					:     str=3		, A					:     str=8		, A					:     Any=7_6_8		, A					:     Dict=1_2		, A					:     Optional[Any]=1_2		, A					:     Any=3_0_7_2		, A					:     str="gelu"		, A					:     Optional[int]=0.0		, A					:     Union[str, Any]=0.0		, A					:     List[Any]=0.02		, A					:     int=1e-6		, A					:     Tuple=True		, A					:     Any="divided_space_time"		, A					:     Optional[Any]=0		, **A					:     Tuple		, )       ->str:
          super().__init__(**A      )

          lowerCamelCase__       :						Optional[Any]        =							image_size
          lowerCamelCase__       :						int        =							patch_size
          lowerCamelCase__       :						Any        =							num_channels
          lowerCamelCase__       :						Optional[int]        =							num_frames

          lowerCamelCase__       :						Optional[Any]        =							hidden_size
          lowerCamelCase__       :						Optional[int]        =							num_hidden_layers
          lowerCamelCase__       :						Optional[int]        =							num_attention_heads
          lowerCamelCase__       :						Dict        =							intermediate_size
          lowerCamelCase__       :						Optional[Any]        =							hidden_act
          lowerCamelCase__       :						Union[str, Any]        =							hidden_dropout_prob
          lowerCamelCase__       :						Dict        =							attention_probs_dropout_prob
          lowerCamelCase__       :						List[Any]        =							initializer_range
          lowerCamelCase__       :						str        =							layer_norm_eps
          lowerCamelCase__       :						Union[str, Any]        =							qkv_bias

          lowerCamelCase__       :						str        =							attention_type
          lowerCamelCase__       :						List[str]        =							drop_path_rate










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



