ultralytics-thop 2.0.17__tar.gz → 2.0.18__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/PKG-INFO +1 -1
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/tests/test_conv2d.py +3 -3
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/__init__.py +2 -2
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/fx_profile.py +2 -2
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/profile.py +1 -1
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/ultralytics_thop.egg-info/PKG-INFO +1 -1
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/LICENSE +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/README.md +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/pyproject.toml +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/setup.cfg +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/tests/test_matmul.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/tests/test_relu.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/tests/test_utils.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/rnn_hooks.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/utils.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/vision/__init__.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/vision/basic_hooks.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/thop/vision/calc_func.py +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/ultralytics_thop.egg-info/SOURCES.txt +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/ultralytics_thop.egg-info/dependency_links.txt +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/ultralytics_thop.egg-info/requires.txt +0 -0
- {ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/ultralytics_thop.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ultralytics-thop
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.18
|
|
4
4
|
Summary: Ultralytics THOP package for fast computation of PyTorch model FLOPs and parameters.
|
|
5
5
|
Author-email: Ligeng Zhu <ligeng.zhu+github@gmail.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
@@ -21,7 +21,7 @@ class TestUtils:
|
|
|
21
21
|
|
|
22
22
|
_, _, oh, ow = out.shape
|
|
23
23
|
print(f"Conv2d: in={ih}x{iw}, kernel={kh}x{kw}, stride={s}, padding={p}, out={oh}x{ow}")
|
|
24
|
-
macs,
|
|
24
|
+
macs, _params = profile(net, inputs=(data,))
|
|
25
25
|
assert macs == 810000, f"{macs} v.s. 810000"
|
|
26
26
|
|
|
27
27
|
def test_conv2d(self):
|
|
@@ -36,7 +36,7 @@ class TestUtils:
|
|
|
36
36
|
|
|
37
37
|
_, _, oh, ow = out.shape
|
|
38
38
|
print(f"Conv2d: in={ih}x{iw}, kernel={kh}x{kw}, stride={s}, padding={p}, out={oh}x{ow}")
|
|
39
|
-
macs,
|
|
39
|
+
macs, _params = profile(net, inputs=(data,))
|
|
40
40
|
assert macs == 810000, f"{macs} v.s. 810000"
|
|
41
41
|
|
|
42
42
|
def test_conv2d_random(self):
|
|
@@ -54,7 +54,7 @@ class TestUtils:
|
|
|
54
54
|
|
|
55
55
|
_, _, oh, ow = out.shape
|
|
56
56
|
print(f"Conv2d: in={ih}x{iw}, kernel={kh}x{kw}, stride={s}, padding={p}, out={oh}x{ow}")
|
|
57
|
-
macs,
|
|
57
|
+
macs, _params = profile(net, inputs=(data,))
|
|
58
58
|
assert macs == n * out_c * oh * ow // g * in_c * kh * kw, (
|
|
59
59
|
f"{macs} v.s. {n * out_c * oh * ow // g * in_c * kh * kw}"
|
|
60
60
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
2
2
|
|
|
3
|
-
__version__ = "2.0.
|
|
3
|
+
__version__ = "2.0.18"
|
|
4
4
|
|
|
5
5
|
import torch
|
|
6
6
|
|
|
@@ -9,4 +9,4 @@ from .utils import clever_format
|
|
|
9
9
|
|
|
10
10
|
default_dtype = torch.float64
|
|
11
11
|
|
|
12
|
-
__all__ = ["
|
|
12
|
+
__all__ = ["clever_format", "default_dtype", "profile", "profile_origin"]
|
|
@@ -49,11 +49,11 @@ def count_fn_conv2d(input_shapes, output_shapes, *args, **kwargs):
|
|
|
49
49
|
"""Calculates total operations (FLOPs) for a 2D conv layer based on input and output shapes using
|
|
50
50
|
`calculate_conv`.
|
|
51
51
|
"""
|
|
52
|
-
|
|
52
|
+
_inputs, _weight, _bias, _stride, _padding, _dilation, groups = args
|
|
53
53
|
if len(input_shapes) == 2:
|
|
54
54
|
x_shape, k_shape = input_shapes
|
|
55
55
|
elif len(input_shapes) == 3:
|
|
56
|
-
x_shape, k_shape,
|
|
56
|
+
x_shape, k_shape, _b_shape = input_shapes
|
|
57
57
|
out_shape = output_shapes[0]
|
|
58
58
|
|
|
59
59
|
kernel_parameters = k_shape[2:].numel()
|
|
@@ -94,7 +94,7 @@ def profile_origin(model, inputs, custom_ops=None, verbose=True, report_missing=
|
|
|
94
94
|
|
|
95
95
|
if hasattr(m, "total_ops") or hasattr(m, "total_params"):
|
|
96
96
|
logging.warning(
|
|
97
|
-
f"Either .total_ops or .total_params is already defined in {
|
|
97
|
+
f"Either .total_ops or .total_params is already defined in {m!s}. "
|
|
98
98
|
"Be careful, it might change your code's behavior."
|
|
99
99
|
)
|
|
100
100
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ultralytics-thop
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.18
|
|
4
4
|
Summary: Ultralytics THOP package for fast computation of PyTorch model FLOPs and parameters.
|
|
5
5
|
Author-email: Ligeng Zhu <ligeng.zhu+github@gmail.com>
|
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ultralytics_thop-2.0.17 → ultralytics_thop-2.0.18}/ultralytics_thop.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|