From 53f4008ebe88727aab9eb8cc3029db445944f1e5 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 22 Jun 2024 13:17:48 +0200 Subject: [PATCH] Refactor code for speed and clarity --- README.md | 2 +- benchmark/evaluate_famous_models.py | 3 +-- benchmark/evaluate_rnn_models.py | 1 - tests/test_conv2d.py | 1 - tests/test_matmul.py | 1 - tests/test_relu.py | 1 - 6 files changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7267aff..0d4239c 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,7 @@ For bugs or feature requests, please open an issue on [GitHub Issues](https://gi space Ultralytics TikTok space - Ultralytics Instagram + Ultralytics BiliBili space Ultralytics Discord diff --git a/benchmark/evaluate_famous_models.py b/benchmark/evaluate_famous_models.py index f641bda..f36615c 100644 --- a/benchmark/evaluate_famous_models.py +++ b/benchmark/evaluate_famous_models.py @@ -1,7 +1,6 @@ import torch -from torchvision import models - from thop.profile import profile +from torchvision import models model_names = sorted( name diff --git a/benchmark/evaluate_rnn_models.py b/benchmark/evaluate_rnn_models.py index d1fad55..2c5060a 100644 --- a/benchmark/evaluate_rnn_models.py +++ b/benchmark/evaluate_rnn_models.py @@ -1,6 +1,5 @@ import torch import torch.nn as nn - from thop.profile import profile input_size = 160 diff --git a/tests/test_conv2d.py b/tests/test_conv2d.py index e058e25..6e3f974 100644 --- a/tests/test_conv2d.py +++ b/tests/test_conv2d.py @@ -1,6 +1,5 @@ import torch import torch.nn as nn - from thop import profile diff --git a/tests/test_matmul.py b/tests/test_matmul.py index 83cc361..e0688b2 100644 --- a/tests/test_matmul.py +++ b/tests/test_matmul.py @@ -1,6 +1,5 @@ import torch import torch.nn as nn - from thop import profile diff --git a/tests/test_relu.py b/tests/test_relu.py index 88739e6..ec916a6 100644 --- a/tests/test_relu.py +++ b/tests/test_relu.py @@ -1,6 +1,5 @@ import torch import torch.nn as nn - from thop import profile