Kernels:
Trusted publisher
Remove builds incompatible with kernels >= 0.14
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- build/torch210-cu128-x86_64-windows/__init__.py +0 -46
- build/torch210-cu128-x86_64-windows/_deformable_detr_cuda_d8a6191.pyd +0 -3
- build/torch210-cu128-x86_64-windows/_ops.py +0 -9
- build/torch210-cu128-x86_64-windows/deformable_detr/__init__.py +0 -26
- build/torch210-cu128-x86_64-windows/layers.py +0 -84
- build/torch210-cu128-x86_64-windows/metadata.json +0 -21
- build/torch211-cu128-x86_64-windows/__init__.py +0 -46
- build/torch211-cu128-x86_64-windows/_deformable_detr_cuda_a4c5c25.pyd +0 -3
- build/torch211-cu128-x86_64-windows/_ops.py +0 -9
- build/torch211-cu128-x86_64-windows/deformable_detr/__init__.py +0 -26
- build/torch211-cu128-x86_64-windows/layers.py +0 -84
- build/torch211-cu128-x86_64-windows/metadata.json +0 -21
- build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/_ops.py +0 -9
- build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/layers.py +0 -84
- build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/__init__.py +0 -46
- build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
- build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/_ops.py +0 -9
- build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/layers.py +0 -84
- build/torch26-cxx11-cu126-x86_64-linux/deformable_detr/__init__.py +0 -46
- build/torch26-cxx11-cu126-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so +0 -3
build/torch210-cu128-x86_64-windows/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch210-cu128-x86_64-windows/_deformable_detr_cuda_d8a6191.pyd
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f94825a148a77c630ae4f24f75f65e96dd6e3379653643aa2e81420ba61a9db3
|
| 3 |
-
size 9546240
|
|
|
|
|
|
|
|
|
|
|
|
build/torch210-cu128-x86_64-windows/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_cuda_d8a6191
|
| 3 |
-
ops = torch.ops._deformable_detr_cuda_d8a6191
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_cuda_d8a6191::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch210-cu128-x86_64-windows/deformable_detr/__init__.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
import ctypes
|
| 2 |
-
import sys
|
| 3 |
-
|
| 4 |
-
import importlib
|
| 5 |
-
from pathlib import Path
|
| 6 |
-
from types import ModuleType
|
| 7 |
-
|
| 8 |
-
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
-
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
-
# it would also be used for other imports. So, we make a module name that
|
| 11 |
-
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
-
# the path.
|
| 13 |
-
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
-
module_name = path_hash
|
| 15 |
-
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
-
if spec is None:
|
| 17 |
-
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
-
module = importlib.util.module_from_spec(spec)
|
| 19 |
-
if module is None:
|
| 20 |
-
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
-
sys.modules[module_name] = module
|
| 22 |
-
spec.loader.exec_module(module) # type: ignore
|
| 23 |
-
return module
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch210-cu128-x86_64-windows/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch210-cu128-x86_64-windows/metadata.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"version": 1,
|
| 3 |
-
"license": "Apache-2.0",
|
| 4 |
-
"python-depends": [],
|
| 5 |
-
"backend": {
|
| 6 |
-
"type": "cuda",
|
| 7 |
-
"archs": [
|
| 8 |
-
"10.0",
|
| 9 |
-
"10.1",
|
| 10 |
-
"12.0+PTX",
|
| 11 |
-
"7.0",
|
| 12 |
-
"7.2",
|
| 13 |
-
"7.5",
|
| 14 |
-
"8.0",
|
| 15 |
-
"8.6",
|
| 16 |
-
"8.7",
|
| 17 |
-
"8.9",
|
| 18 |
-
"9.0"
|
| 19 |
-
]
|
| 20 |
-
}
|
| 21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch211-cu128-x86_64-windows/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch211-cu128-x86_64-windows/_deformable_detr_cuda_a4c5c25.pyd
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:6901592b0cde22932ed33bd9357fdbff9747d916c56fc25ffa455d7bb575bef5
|
| 3 |
-
size 9546240
|
|
|
|
|
|
|
|
|
|
|
|
build/torch211-cu128-x86_64-windows/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_cuda_a4c5c25
|
| 3 |
-
ops = torch.ops._deformable_detr_cuda_a4c5c25
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_cuda_a4c5c25::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch211-cu128-x86_64-windows/deformable_detr/__init__.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
import ctypes
|
| 2 |
-
import importlib.util
|
| 3 |
-
import sys
|
| 4 |
-
from pathlib import Path
|
| 5 |
-
from types import ModuleType
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def _import_from_path(file_path: Path) -> ModuleType:
|
| 9 |
-
# We cannot use the module name as-is, after adding it to `sys.modules`,
|
| 10 |
-
# it would also be used for other imports. So, we make a module name that
|
| 11 |
-
# depends on the path for it to be unique using the hex-encoded hash of
|
| 12 |
-
# the path.
|
| 13 |
-
path_hash = "{:x}".format(ctypes.c_size_t(hash(file_path.absolute())).value)
|
| 14 |
-
module_name = path_hash
|
| 15 |
-
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
| 16 |
-
if spec is None:
|
| 17 |
-
raise ImportError(f"Cannot load spec for {module_name} from {file_path}")
|
| 18 |
-
module = importlib.util.module_from_spec(spec)
|
| 19 |
-
if module is None:
|
| 20 |
-
raise ImportError(f"Cannot load module {module_name} from spec")
|
| 21 |
-
sys.modules[module_name] = module
|
| 22 |
-
spec.loader.exec_module(module) # type: ignore
|
| 23 |
-
return module
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
globals().update(vars(_import_from_path(Path(__file__).parent.parent / "__init__.py")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch211-cu128-x86_64-windows/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch211-cu128-x86_64-windows/metadata.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"version": 1,
|
| 3 |
-
"license": "Apache-2.0",
|
| 4 |
-
"python-depends": [],
|
| 5 |
-
"backend": {
|
| 6 |
-
"type": "cuda",
|
| 7 |
-
"archs": [
|
| 8 |
-
"10.0",
|
| 9 |
-
"10.1",
|
| 10 |
-
"12.0+PTX",
|
| 11 |
-
"7.0",
|
| 12 |
-
"7.2",
|
| 13 |
-
"7.5",
|
| 14 |
-
"8.0",
|
| 15 |
-
"8.6",
|
| 16 |
-
"8.7",
|
| 17 |
-
"8.9",
|
| 18 |
-
"9.0"
|
| 19 |
-
]
|
| 20 |
-
}
|
| 21 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:ae00c12295a458e2534149aea16da0289541447123c19fae59baaf6d6d2752f1
|
| 3 |
-
size 6693656
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu118-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:4ab8cf59779b768359df0fa268b6cd52be2f518dd4fafdd61baec31c64f44813
|
| 3 |
-
size 6679440
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu121-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5cdcd6902a03140074cff4cd44bf6b47dc27a32e13e0515a93929c66be186cab
|
| 3 |
-
size 6652680
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx11-cu124-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:82174ec2812ee672a447b94fb5ec907e348eb3d0be338daddf145a1d74969a6f
|
| 3 |
-
size 6686592
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu118-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c9d8540a4ffa00d331f60204fe6baf543a45667d6bba2c0a0b23aca9202b6233
|
| 3 |
-
size 6672464
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu121-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:fa748a4de72c06de09f46b4af4fec7f23cb2c76eb8683c117fefd20833cd3fd8
|
| 3 |
-
size 6649800
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch25-cxx98-cu124-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:57e38bac3087c1446307e504b1e22e61ae584d1de7f5b3d15bd7a60780c3431c
|
| 3 |
-
size 6693632
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu118-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:1d7c09d3bedd89d7119e7023a07784724d3a3f79664b75fce37b778ef3bcfe52
|
| 3 |
-
size 6648656
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu124-x86_64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:6856b6efe5130f019f6cb7f964d7a2073f1ecc5cd7afc850334e64798f871dae
|
| 3 |
-
size 6833224
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/_ops.py
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
from . import _deformable_detr_7c33cbe
|
| 3 |
-
ops = torch.ops._deformable_detr_7c33cbe
|
| 4 |
-
|
| 5 |
-
def add_op_namespace_prefix(op_name: str):
|
| 6 |
-
"""
|
| 7 |
-
Prefix op by namespace.
|
| 8 |
-
"""
|
| 9 |
-
return f"_deformable_detr_7c33cbe::{op_name}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu126-aarch64-linux/deformable_detr/layers.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
| 1 |
-
from typing import List, Union, Tuple
|
| 2 |
-
|
| 3 |
-
from torch import Tensor
|
| 4 |
-
from torch.autograd import Function
|
| 5 |
-
from torch.autograd.function import once_differentiable
|
| 6 |
-
import torch.nn as nn
|
| 7 |
-
|
| 8 |
-
from ._ops import ops
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
class MultiScaleDeformableAttentionFunction(Function):
|
| 12 |
-
@staticmethod
|
| 13 |
-
def forward(
|
| 14 |
-
context,
|
| 15 |
-
value: Tensor,
|
| 16 |
-
value_spatial_shapes: Tensor,
|
| 17 |
-
value_level_start_index: Tensor,
|
| 18 |
-
sampling_locations: Tensor,
|
| 19 |
-
attention_weights: Tensor,
|
| 20 |
-
im2col_step: int,
|
| 21 |
-
):
|
| 22 |
-
context.im2col_step = im2col_step
|
| 23 |
-
output = ops.ms_deform_attn_forward(
|
| 24 |
-
value,
|
| 25 |
-
value_spatial_shapes,
|
| 26 |
-
value_level_start_index,
|
| 27 |
-
sampling_locations,
|
| 28 |
-
attention_weights,
|
| 29 |
-
context.im2col_step,
|
| 30 |
-
)
|
| 31 |
-
context.save_for_backward(
|
| 32 |
-
value,
|
| 33 |
-
value_spatial_shapes,
|
| 34 |
-
value_level_start_index,
|
| 35 |
-
sampling_locations,
|
| 36 |
-
attention_weights,
|
| 37 |
-
)
|
| 38 |
-
return output
|
| 39 |
-
|
| 40 |
-
@staticmethod
|
| 41 |
-
@once_differentiable
|
| 42 |
-
def backward(context, grad_output):
|
| 43 |
-
(
|
| 44 |
-
value,
|
| 45 |
-
value_spatial_shapes,
|
| 46 |
-
value_level_start_index,
|
| 47 |
-
sampling_locations,
|
| 48 |
-
attention_weights,
|
| 49 |
-
) = context.saved_tensors
|
| 50 |
-
grad_value, grad_sampling_loc, grad_attn_weight = ops.ms_deform_attn_backward(
|
| 51 |
-
value,
|
| 52 |
-
value_spatial_shapes,
|
| 53 |
-
value_level_start_index,
|
| 54 |
-
sampling_locations,
|
| 55 |
-
attention_weights,
|
| 56 |
-
grad_output,
|
| 57 |
-
context.im2col_step,
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
return grad_value, None, None, grad_sampling_loc, grad_attn_weight, None
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
class MultiScaleDeformableAttention(nn.Module):
|
| 64 |
-
def forward(
|
| 65 |
-
self,
|
| 66 |
-
value: Tensor,
|
| 67 |
-
value_spatial_shapes: Tensor,
|
| 68 |
-
value_spatial_shapes_list: List[Tuple],
|
| 69 |
-
level_start_index: Tensor,
|
| 70 |
-
sampling_locations: Tensor,
|
| 71 |
-
attention_weights: Tensor,
|
| 72 |
-
im2col_step: int,
|
| 73 |
-
):
|
| 74 |
-
return MultiScaleDeformableAttentionFunction.apply(
|
| 75 |
-
value,
|
| 76 |
-
value_spatial_shapes,
|
| 77 |
-
level_start_index,
|
| 78 |
-
sampling_locations,
|
| 79 |
-
attention_weights,
|
| 80 |
-
im2col_step,
|
| 81 |
-
)
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
__all__ = ["MultiScaleDeformableAttention"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu126-x86_64-linux/deformable_detr/__init__.py
DELETED
|
@@ -1,46 +0,0 @@
|
|
| 1 |
-
from typing import List
|
| 2 |
-
import torch
|
| 3 |
-
|
| 4 |
-
from ._ops import ops
|
| 5 |
-
from . import layers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def ms_deform_attn_backward(
|
| 9 |
-
value: torch.Tensor,
|
| 10 |
-
spatial_shapes: torch.Tensor,
|
| 11 |
-
level_start_index: torch.Tensor,
|
| 12 |
-
sampling_loc: torch.Tensor,
|
| 13 |
-
attn_weight: torch.Tensor,
|
| 14 |
-
grad_output: torch.Tensor,
|
| 15 |
-
im2col_step: int,
|
| 16 |
-
) -> List[torch.Tensor]:
|
| 17 |
-
return ops.ms_deform_attn_backward(
|
| 18 |
-
value,
|
| 19 |
-
spatial_shapes,
|
| 20 |
-
level_start_index,
|
| 21 |
-
sampling_loc,
|
| 22 |
-
attn_weight,
|
| 23 |
-
grad_output,
|
| 24 |
-
im2col_step,
|
| 25 |
-
)
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
def ms_deform_attn_forward(
|
| 29 |
-
value: torch.Tensor,
|
| 30 |
-
spatial_shapes: torch.Tensor,
|
| 31 |
-
level_start_index: torch.Tensor,
|
| 32 |
-
sampling_loc: torch.Tensor,
|
| 33 |
-
attn_weight: torch.Tensor,
|
| 34 |
-
im2col_step: int,
|
| 35 |
-
) -> torch.Tensor:
|
| 36 |
-
return ops.ms_deform_attn_forward(
|
| 37 |
-
value,
|
| 38 |
-
spatial_shapes,
|
| 39 |
-
level_start_index,
|
| 40 |
-
sampling_loc,
|
| 41 |
-
attn_weight,
|
| 42 |
-
im2col_step,
|
| 43 |
-
)
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
__all__ = ["layers", "ms_deform_attn_forward", "ms_deform_attn_backward"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build/torch26-cxx11-cu126-x86_64-linux/deformable_detr/_deformable_detr_7c33cbe.abi3.so
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c76ad874b78882d3108a7fdaf49f8c00b6a6a7dceec63912118f8fa7d07e5f30
|
| 3 |
-
size 6800656
|
|
|
|
|
|
|
|
|
|
|
|