Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize license headers in Python files #79

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions benchmark/evaluate_famous_models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import torch
from torchvision import models

Expand Down
2 changes: 2 additions & 0 deletions benchmark/evaluate_rnn_models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import torch
import torch.nn as nn

Expand Down
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license
8 changes: 5 additions & 3 deletions tests/test_conv2d.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import torch
import torch.nn as nn

Expand Down Expand Up @@ -54,6 +56,6 @@ def test_conv2d_random(self):

flops, params = profile(net, inputs=(data,))
print(flops, params)
assert (
flops == n * out_c * oh * ow // g * in_c * kh * kw
), f"{flops} v.s. {n * out_c * oh * ow // g * in_c * kh * kw}"
assert flops == n * out_c * oh * ow // g * in_c * kh * kw, (
f"{flops} v.s. {n * out_c * oh * ow // g * in_c * kh * kw}"
)
2 changes: 2 additions & 0 deletions tests/test_matmul.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import torch
import torch.nn as nn

Expand Down
2 changes: 2 additions & 0 deletions tests/test_relu.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import torch
import torch.nn as nn

Expand Down
2 changes: 2 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

from thop import utils


Expand Down
2 changes: 2 additions & 0 deletions thop/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

__version__ = "2.0.13"


Expand Down
5 changes: 3 additions & 2 deletions thop/fx_profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import logging
from distutils.version import LooseVersion

Expand All @@ -7,8 +9,7 @@

if LooseVersion(torch.__version__) < LooseVersion("1.8.0"):
logging.warning(
f"torch.fx requires version higher than 1.8.0. "
f"But You are using an old version PyTorch {torch.__version__}. "
f"torch.fx requires version higher than 1.8.0. But You are using an old version PyTorch {torch.__version__}. "
)


Expand Down
2 changes: 2 additions & 0 deletions thop/profile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

from thop.rnn_hooks import *
from thop.vision.basic_hooks import *

Expand Down
2 changes: 2 additions & 0 deletions thop/rnn_hooks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import torch
import torch.nn as nn
from torch.nn.utils.rnn import PackedSequence
Expand Down
2 changes: 2 additions & 0 deletions thop/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

from collections.abc import Iterable

COLOR_RED = "91m"
Expand Down
1 change: 1 addition & 0 deletions thop/vision/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license
2 changes: 2 additions & 0 deletions thop/vision/basic_hooks.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import logging

import torch.nn as nn
Expand Down
2 changes: 2 additions & 0 deletions thop/vision/calc_func.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ultralytics πŸš€ AGPL-3.0 License - https://ultralytics.com/license

import warnings

import numpy as np
Expand Down
Loading