drbh commited on
Commit
81c3b07
·
unverified ·
0 Parent(s):

Migrated from kernels-community/cv-utils

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +71 -0
  2. build/torch210-cu128-x86_64-windows/__init__.py +12 -0
  3. build/torch210-cu128-x86_64-windows/_cv_utils_cuda_0561e14.pyd +3 -0
  4. build/torch210-cu128-x86_64-windows/_ops.py +9 -0
  5. build/torch210-cu128-x86_64-windows/cv_utils/__init__.py +26 -0
  6. build/torch210-cu128-x86_64-windows/metadata.json +20 -0
  7. build/torch210-cxx11-cu126-aarch64-linux/__init__.py +12 -0
  8. build/torch210-cxx11-cu126-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  9. build/torch210-cxx11-cu126-aarch64-linux/_ops.py +9 -0
  10. build/torch210-cxx11-cu126-aarch64-linux/cv_utils/__init__.py +26 -0
  11. build/torch210-cxx11-cu126-aarch64-linux/metadata.json +17 -0
  12. build/torch210-cxx11-cu126-x86_64-linux/__init__.py +12 -0
  13. build/torch210-cxx11-cu126-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  14. build/torch210-cxx11-cu126-x86_64-linux/_ops.py +9 -0
  15. build/torch210-cxx11-cu126-x86_64-linux/cv_utils/__init__.py +26 -0
  16. build/torch210-cxx11-cu126-x86_64-linux/metadata.json +17 -0
  17. build/torch210-cxx11-cu128-aarch64-linux/__init__.py +12 -0
  18. build/torch210-cxx11-cu128-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  19. build/torch210-cxx11-cu128-aarch64-linux/_ops.py +9 -0
  20. build/torch210-cxx11-cu128-aarch64-linux/cv_utils/__init__.py +26 -0
  21. build/torch210-cxx11-cu128-aarch64-linux/metadata.json +20 -0
  22. build/torch210-cxx11-cu128-x86_64-linux/__init__.py +12 -0
  23. build/torch210-cxx11-cu128-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  24. build/torch210-cxx11-cu128-x86_64-linux/_ops.py +9 -0
  25. build/torch210-cxx11-cu128-x86_64-linux/cv_utils/__init__.py +26 -0
  26. build/torch210-cxx11-cu128-x86_64-linux/metadata.json +20 -0
  27. build/torch210-cxx11-cu130-aarch64-linux/__init__.py +12 -0
  28. build/torch210-cxx11-cu130-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  29. build/torch210-cxx11-cu130-aarch64-linux/_ops.py +9 -0
  30. build/torch210-cxx11-cu130-aarch64-linux/cv_utils/__init__.py +26 -0
  31. build/torch210-cxx11-cu130-aarch64-linux/metadata.json +18 -0
  32. build/torch210-cxx11-cu130-x86_64-linux/__init__.py +12 -0
  33. build/torch210-cxx11-cu130-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  34. build/torch210-cxx11-cu130-x86_64-linux/_ops.py +9 -0
  35. build/torch210-cxx11-cu130-x86_64-linux/cv_utils/__init__.py +26 -0
  36. build/torch210-cxx11-cu130-x86_64-linux/metadata.json +18 -0
  37. build/torch211-cxx11-cu126-aarch64-linux/__init__.py +12 -0
  38. build/torch211-cxx11-cu126-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  39. build/torch211-cxx11-cu126-aarch64-linux/_ops.py +9 -0
  40. build/torch211-cxx11-cu126-aarch64-linux/cv_utils/__init__.py +26 -0
  41. build/torch211-cxx11-cu126-aarch64-linux/metadata.json +17 -0
  42. build/torch211-cxx11-cu126-x86_64-linux/__init__.py +12 -0
  43. build/torch211-cxx11-cu126-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  44. build/torch211-cxx11-cu126-x86_64-linux/_ops.py +9 -0
  45. build/torch211-cxx11-cu126-x86_64-linux/cv_utils/__init__.py +26 -0
  46. build/torch211-cxx11-cu126-x86_64-linux/metadata.json +17 -0
  47. build/torch211-cxx11-cu128-aarch64-linux/__init__.py +12 -0
  48. build/torch211-cxx11-cu128-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so +3 -0
  49. build/torch211-cxx11-cu128-aarch64-linux/_ops.py +9 -0
  50. build/torch211-cxx11-cu128-aarch64-linux/cv_utils/__init__.py +26 -0
.gitattributes ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ build/torch210-cxx11-cu126-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
37
+ build/torch210-cxx11-cu128-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
38
+ build/torch210-cxx11-cu130-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
39
+ build/torch28-cxx11-cu126-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
40
+ build/torch28-cxx11-cu128-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
41
+ build/torch28-cxx11-cu129-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
42
+ build/torch29-cxx11-cu126-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
43
+ build/torch29-cxx11-cu128-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
44
+ build/torch29-cxx11-cu130-x86_64-linux/_cv_utils_8541a33.abi3.so filter=lfs diff=lfs merge=lfs -text
45
+ build/torch210-cxx11-cu126-aarch64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
46
+ build/torch210-cxx11-cu128-aarch64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
47
+ build/torch210-cxx11-cu130-aarch64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
48
+ build/torch29-cxx11-cu126-aarch64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
49
+ build/torch29-cxx11-cu128-aarch64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
50
+ build/torch29-cxx11-cu130-aarch64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
51
+ build/torch210-cxx11-cu126-x86_64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
52
+ build/torch210-cxx11-cu128-x86_64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
53
+ build/torch210-cxx11-cu130-x86_64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
54
+ build/torch29-cxx11-cu126-x86_64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
55
+ build/torch29-cxx11-cu128-x86_64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
56
+ build/torch29-cxx11-cu130-x86_64-linux/_cv_utils_cuda_8cfc281.abi3.so filter=lfs diff=lfs merge=lfs -text
57
+ build/torch210-cu128-x86_64-windows/_cv_utils_cuda_0561e14.pyd filter=lfs diff=lfs merge=lfs -text
58
+ build/torch210-cxx11-cu126-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
59
+ build/torch210-cxx11-cu128-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
60
+ build/torch210-cxx11-cu130-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
61
+ build/torch211-cxx11-cu126-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
62
+ build/torch211-cxx11-cu128-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
63
+ build/torch211-cxx11-cu130-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
64
+ build/torch29-cxx11-cu129-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
65
+ build/torch210-cxx11-cu126-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
66
+ build/torch210-cxx11-cu128-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
67
+ build/torch210-cxx11-cu130-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
68
+ build/torch211-cxx11-cu126-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
69
+ build/torch211-cxx11-cu128-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
70
+ build/torch211-cxx11-cu130-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
71
+ build/torch29-cxx11-cu129-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so filter=lfs diff=lfs merge=lfs -text
build/torch210-cu128-x86_64-windows/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cu128-x86_64-windows/_cv_utils_cuda_0561e14.pyd ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:421b973a2ce02fe068ac5015ebb50d55a46abdb1f5eceb9f3dbc32383505be5b
3
+ size 1782784
build/torch210-cu128-x86_64-windows/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_0561e14
3
+ ops = torch.ops._cv_utils_cuda_0561e14
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_0561e14::{op_name}"
build/torch210-cu128-x86_64-windows/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/metadata.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "10.1",
9
+ "12.0+PTX",
10
+ "7.0",
11
+ "7.2",
12
+ "7.5",
13
+ "8.0",
14
+ "8.6",
15
+ "8.7",
16
+ "8.9",
17
+ "9.0"
18
+ ]
19
+ }
20
+ }
build/torch210-cxx11-cu126-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cxx11-cu126-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:85951892e9264e890bc78648406d030328cf1082440fe9ee78cdd0c519573cba
3
+ size 3168896
build/torch210-cxx11-cu126-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch210-cxx11-cu126-aarch64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu126-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "7.0",
8
+ "7.2",
9
+ "7.5",
10
+ "8.0",
11
+ "8.6",
12
+ "8.7",
13
+ "8.9",
14
+ "9.0+PTX"
15
+ ]
16
+ }
17
+ }
build/torch210-cxx11-cu126-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cxx11-cu126-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8570f8f8239587bffe735225297b3c68d6687599301bc53dd70c3dd059306b0c
3
+ size 3049648
build/torch210-cxx11-cu126-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch210-cxx11-cu126-x86_64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu126-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "7.0",
8
+ "7.2",
9
+ "7.5",
10
+ "8.0",
11
+ "8.6",
12
+ "8.7",
13
+ "8.9",
14
+ "9.0+PTX"
15
+ ]
16
+ }
17
+ }
build/torch210-cxx11-cu128-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cxx11-cu128-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2c80b066ed750b4a5b7f1f11a0d77427f0f0e99118ccbd9b8317c67f5a86adad
3
+ size 3824424
build/torch210-cxx11-cu128-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch210-cxx11-cu128-aarch64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu128-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "10.1",
9
+ "12.0+PTX",
10
+ "7.0",
11
+ "7.2",
12
+ "7.5",
13
+ "8.0",
14
+ "8.6",
15
+ "8.7",
16
+ "8.9",
17
+ "9.0"
18
+ ]
19
+ }
20
+ }
build/torch210-cxx11-cu128-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cxx11-cu128-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af1c42d352ffee1254cbfcb240d0e6b3aa12b3db7a42720952b368e1abcf480e
3
+ size 3735552
build/torch210-cxx11-cu128-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch210-cxx11-cu128-x86_64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu128-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "10.1",
9
+ "12.0+PTX",
10
+ "7.0",
11
+ "7.2",
12
+ "7.5",
13
+ "8.0",
14
+ "8.6",
15
+ "8.7",
16
+ "8.9",
17
+ "9.0"
18
+ ]
19
+ }
20
+ }
build/torch210-cxx11-cu130-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cxx11-cu130-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7483b27cbdd39dbe19814440aa97a22fce61635c2cb22ce510a5430d75a99d69
3
+ size 3633848
build/torch210-cxx11-cu130-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch210-cxx11-cu130-aarch64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu130-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "11.0",
9
+ "12.0+PTX",
10
+ "7.5",
11
+ "8.0",
12
+ "8.6",
13
+ "8.7",
14
+ "8.9",
15
+ "9.0"
16
+ ]
17
+ }
18
+ }
build/torch210-cxx11-cu130-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch210-cxx11-cu130-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:499b4704cfef394926ac41eba5dfe418a021aafabb8508af84cfe8c146dd2703
3
+ size 3518288
build/torch210-cxx11-cu130-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch210-cxx11-cu130-x86_64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/torch210-cxx11-cu130-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "10.0",
8
+ "11.0",
9
+ "12.0+PTX",
10
+ "7.5",
11
+ "8.0",
12
+ "8.6",
13
+ "8.7",
14
+ "8.9",
15
+ "9.0"
16
+ ]
17
+ }
18
+ }
build/torch211-cxx11-cu126-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch211-cxx11-cu126-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2dbbfc5bf524a337e8b6900179e1df4a951ce95e2453691a4fb2c9a6ca2df3b9
3
+ size 3165104
build/torch211-cxx11-cu126-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch211-cxx11-cu126-aarch64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-cxx11-cu126-aarch64-linux/metadata.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "7.0",
8
+ "7.2",
9
+ "7.5",
10
+ "8.0",
11
+ "8.6",
12
+ "8.7",
13
+ "8.9",
14
+ "9.0+PTX"
15
+ ]
16
+ }
17
+ }
build/torch211-cxx11-cu126-x86_64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch211-cxx11-cu126-x86_64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41f1f524c80be56fdfd22b5a72a15a939043eaa357df32af9272cabaa74f9884
3
+ size 3042584
build/torch211-cxx11-cu126-x86_64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch211-cxx11-cu126-x86_64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-cxx11-cu126-x86_64-linux/metadata.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "python-depends": [],
4
+ "backend": {
5
+ "type": "cuda",
6
+ "archs": [
7
+ "7.0",
8
+ "7.2",
9
+ "7.5",
10
+ "8.0",
11
+ "8.6",
12
+ "8.7",
13
+ "8.9",
14
+ "9.0+PTX"
15
+ ]
16
+ }
17
+ }
build/torch211-cxx11-cu128-aarch64-linux/__init__.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from typing import List
3
+
4
+ from ._ops import ops
5
+
6
+ def cc_2d(inputs: torch.Tensor, get_counts: bool) -> List[torch.Tensor]:
7
+ return ops.cc_2d(inputs, get_counts)
8
+
9
+ def generic_nms(dets: torch.Tensor, scores: torch.Tensor, iou_threshold: float, use_iou_matrix: bool) -> torch.Tensor:
10
+ return ops.generic_nms(dets, scores, iou_threshold, use_iou_matrix)
11
+
12
+ __all__ = ["cc_2d", "generic_nms"]
build/torch211-cxx11-cu128-aarch64-linux/_cv_utils_cuda_d91fc8d.abi3.so ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79587ea9ec0c69d9dbcc51298483eb3794d06adb73d9e463ad7ac1ea52232e7b
3
+ size 3820640
build/torch211-cxx11-cu128-aarch64-linux/_ops.py ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ from . import _cv_utils_cuda_d91fc8d
3
+ ops = torch.ops._cv_utils_cuda_d91fc8d
4
+
5
+ def add_op_namespace_prefix(op_name: str):
6
+ """
7
+ Prefix op by namespace.
8
+ """
9
+ return f"_cv_utils_cuda_d91fc8d::{op_name}"
build/torch211-cxx11-cu128-aarch64-linux/cv_utils/__init__.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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")))