danieldk HF Staff commited on
Commit
2c8e21f
·
verified ·
1 Parent(s): a5a9028

Build uploaded using `kernels`.

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  2. build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  3. build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  4. build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/{_deformable_detr_7c33cbe.abi3.so → _deformable_detr_57c3d32.abi3.so} +2 -2
  5. build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/_ops.py +3 -3
  6. build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  7. build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  8. build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  9. build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/{_deformable_detr_7c33cbe.abi3.so → _deformable_detr_57c3d32.abi3.so} +2 -2
  10. build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/_ops.py +3 -3
  11. build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  12. build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  13. build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  14. build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/{_deformable_detr_7c33cbe.abi3.so → _deformable_detr_57c3d32.abi3.so} +2 -2
  15. build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/_ops.py +3 -3
  16. build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  17. build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  18. build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  19. build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/{_deformable_detr_e82640e_dirty.abi3.so → _deformable_detr_57c3d32.abi3.so} +2 -2
  20. build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/_ops.py +3 -3
  21. build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  22. build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  23. build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  24. build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so +3 -0
  25. build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/_deformable_detr_e82640e_dirty.abi3.so +0 -3
  26. build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/_ops.py +3 -3
  27. build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  28. build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  29. build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  30. build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so +3 -0
  31. build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/_deformable_detr_e82640e_dirty.abi3.so +0 -3
  32. build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/_ops.py +3 -3
  33. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__init__.py +46 -0
  34. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  35. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  36. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  37. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so +3 -0
  38. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/_ops.py +9 -0
  39. build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/layers.py +84 -0
  40. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__init__.py +46 -0
  41. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  42. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  43. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
  44. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so +3 -0
  45. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/_ops.py +9 -0
  46. build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/layers.py +84 -0
  47. build/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__init__.py +46 -0
  48. build/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc +0 -0
  49. build/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc +0 -0
  50. build/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc +0 -0
build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/{_deformable_detr_7c33cbe.abi3.so → _deformable_detr_57c3d32.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:20ee462e214e11abd65b44259847f7dbf535b94a3003357251c53a72f4ac4392
3
- size 6693728
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9293f97cc6b06bc3ba5e57cfd084abb252c287f4518935208e67e126e7cbd19b
3
+ size 6800224
build/torch27-cxx11-cu118-x86_64-linux/deformable_detr/_ops.py CHANGED
@@ -1,9 +1,9 @@
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}"
 
1
  import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/{_deformable_detr_7c33cbe.abi3.so → _deformable_detr_57c3d32.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c2a2064d5d7b5f62704d4cad6a530dd812804cfcc426889030fefdcc553828d3
3
- size 6800688
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df54f46f59b5b78b15314cb0825d8f1f34c7a3198e9d62ca2a65a8ca72ea79a4
3
+ size 6911280
build/torch27-cxx11-cu126-x86_64-linux/deformable_detr/_ops.py CHANGED
@@ -1,9 +1,9 @@
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}"
 
1
  import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/{_deformable_detr_7c33cbe.abi3.so → _deformable_detr_57c3d32.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1f819d4d59e9ea2ce0afd8a0198784cb9f1c3100a0d352261bf84d5b8570cda7
3
- size 9796776
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f389536870cd4acf36ab8f12d3b0bf9f847ec06e2cfc25905420796884b614e
3
+ size 9907368
build/torch27-cxx11-cu128-x86_64-linux/deformable_detr/_ops.py CHANGED
@@ -1,9 +1,9 @@
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}"
 
1
  import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/{_deformable_detr_e82640e_dirty.abi3.so → _deformable_detr_57c3d32.abi3.so} RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:8877a2159e6f4f04905120af8d10ab9b8294aff80b97a584d6a6716922141b46
3
- size 6802152
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:849b408dcea47846a61de3e2c5dc178297e38ac85542e99d737887da93b199e6
3
+ size 6920920
build/torch28-cxx11-cu126-x86_64-linux/deformable_detr/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _deformable_detr_e82640e_dirty
3
- ops = torch.ops._deformable_detr_e82640e_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_deformable_detr_e82640e_dirty::{op_name}"
 
1
  import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:488b575c5239b051da77051e49fe2b33d62574ed4cae68f71e0758527eee5536
3
+ size 9908376
build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/_deformable_detr_e82640e_dirty.abi3.so DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f6bfdf67f0c09d9f194c5c18e7090b0656303627b0725545a6d9bc1070e23773
3
- size 9793704
 
 
 
 
build/torch28-cxx11-cu128-x86_64-linux/deformable_detr/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _deformable_detr_e82640e_dirty
3
- ops = torch.ops._deformable_detr_e82640e_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_deformable_detr_e82640e_dirty::{op_name}"
 
1
  import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5cd16143ec4df47d54c69fef2541ae9a03ac5f8c2c018526822f7ae321510d7
3
+ size 9962640
build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/_deformable_detr_e82640e_dirty.abi3.so DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:90e39e7e29a04b5c6696b2c5dc12af375b217223366b0c7b627c1e9150f5fa9c
3
- size 9811104
 
 
 
 
build/torch28-cxx11-cu129-x86_64-linux/deformable_detr/_ops.py CHANGED
@@ -1,9 +1,9 @@
1
  import torch
2
- from . import _deformable_detr_e82640e_dirty
3
- ops = torch.ops._deformable_detr_e82640e_dirty
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
- return f"_deformable_detr_e82640e_dirty::{op_name}"
 
1
  import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
 
5
  def add_op_namespace_prefix(op_name: str):
6
  """
7
  Prefix op by namespace.
8
  """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__init__.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:00131225eeba3d13bf037c67017b3e1ff8ce61ba77e874af2f2dd817aec5f7b5
3
+ size 6921080
build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch29-cxx11-cu126-x86_64-linux/deformable_detr/layers.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__init__.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file
 
build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/_deformable_detr_57c3d32.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:25d345fba3f6c5317be583824806525f0a7d468e9b57c4535bb7cd87ca60955f
3
+ size 9908536
build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _deformable_detr_57c3d32
3
+ ops = torch.ops._deformable_detr_57c3d32
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_deformable_detr_57c3d32::{op_name}"
build/torch29-cxx11-cu128-x86_64-linux/deformable_detr/layers.py ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__init__.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__pycache__/__init__.cpython-313.pyc ADDED
Binary file (1.5 kB). View file
 
build/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__pycache__/_ops.cpython-313.pyc ADDED
Binary file (541 Bytes). View file
 
build/torch29-cxx11-cu130-x86_64-linux/deformable_detr/__pycache__/layers.cpython-313.pyc ADDED
Binary file (2.74 kB). View file