Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
UltralyticsAssistant committed Jun 20, 2024
1 parent af86310 commit 9885efd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ pip install --upgrade git+https://github.com/ultralytics/thop.git
To profile a model, you can use the following example:

```python
import torch
from torchvision.models import resnet50

from thop import profile
import torch

model = resnet50()
input = torch.randn(1, 3, 224, 224)
Expand Down
3 changes: 2 additions & 1 deletion benchmark/evaluate_famous_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import torch
from thop.profile import profile
from torchvision import models

from thop.profile import profile

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

from thop.profile import profile

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

from thop import profile


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

from thop import profile


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

from thop import profile


Expand Down

0 comments on commit 9885efd

Please sign in to comment.