Skip to content

Commit

Permalink
Refactor code for speed and clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jul 5, 2024
1 parent e945245 commit d3aea92
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Welcome to the [THOP](https://github.com/ultralytics/thop) repository, your comprehensive solution for profiling PyTorch models by computing the number of Multiply-Accumulate Operations (MACs) and parameters. This tool is essential for deep learning practitioners to evaluate model efficiency and performance.

[![GitHub Actions](https://github.com/ultralytics/thop/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/thop/actions/workflows/main.yml) <a href="https://ultralytics.com/discord"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a>
[![GitHub Actions](https://github.com/ultralytics/thop/actions/workflows/format.yml/badge.svg)](https://github.com/ultralytics/thop/actions/workflows/main.yml) <a href="https://ultralytics.com/discord"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a> <a href="https://community.ultralytics.com"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a>

## 📄 Description

Expand Down
3 changes: 1 addition & 2 deletions benchmark/evaluate_famous_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import torch
from torchvision import models

from thop.profile import profile
from torchvision import models

model_names = sorted(
name
Expand Down
1 change: 0 additions & 1 deletion benchmark/evaluate_rnn_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import torch
import torch.nn as nn

from thop.profile import profile

input_size = 160
Expand Down
1 change: 0 additions & 1 deletion tests/test_conv2d.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import torch
import torch.nn as nn

from thop import profile


Expand Down
1 change: 0 additions & 1 deletion tests/test_matmul.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import torch
import torch.nn as nn

from thop import profile


Expand Down
1 change: 0 additions & 1 deletion tests/test_relu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import torch
import torch.nn as nn

from thop import profile


Expand Down

0 comments on commit d3aea92

Please sign in to comment.