Skip to content

Commit

Permalink
test(codspeed): remove numerous decorators for investigation
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm committed Aug 29, 2024
1 parent 2794c71 commit 7dcc0d4
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions tests/test_methods_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def _verify_cam(activation_map, output_size):
("ISCAM", "features.16.conv.3", None, 4, (7, 7), 1),
],
)
@pytest.mark.benchmark
def test_img_cams(
cam_name,
target_layer,
Expand Down Expand Up @@ -76,7 +75,6 @@ def test_img_cams(
_verify_cam(extractor(list(range(batch_size)), scores)[0], (batch_size, *output_size))


@pytest.mark.benchmark
def test_cam_conv1x1(mock_fullyconv_model):
with activation.CAM(mock_fullyconv_model, fc_layer="1") as extractor, torch.no_grad():
scores = mock_fullyconv_model(torch.rand((1, 3, 32, 32)))
Expand All @@ -93,7 +91,6 @@ def test_cam_conv1x1(mock_fullyconv_model):
("ISCAM", "0.3", 4, (1, 8, 16, 16)),
],
)
@pytest.mark.benchmark
def test_video_cams(
cam_name,
target_layer,
Expand Down
2 changes: 0 additions & 2 deletions tests/test_methods_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def test_cam_precheck(mock_img_model, mock_img_tensor):
((8, 8, 8, 8), 3),
],
)
@pytest.mark.benchmark
def test_cam_normalize(input_shape, spatial_dims):
input_tensor = torch.rand(input_shape)
normalized_tensor = core._CAM._normalize(input_tensor, spatial_dims)
Expand Down Expand Up @@ -102,7 +101,6 @@ def test_cam_repr(mock_img_model):
assert repr(extractor) == "_CAM(target_layer=['0.3'])"


@pytest.mark.benchmark
def test_fuse_cams():
with pytest.raises(TypeError):
core._CAM.fuse_cams(torch.zeros((3, 32, 32)))
Expand Down
2 changes: 0 additions & 2 deletions tests/test_methods_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def _verify_cam(activation_map, output_size):
("LayerCAM", "features.18.0", (7, 7), 2),
],
)
@pytest.mark.benchmark
def test_img_cams(cam_name, target_layer, output_size, batch_size, mock_img_tensor):
model = mobilenet_v2(weights=None).eval()
for p in model.parameters():
Expand Down Expand Up @@ -73,7 +72,6 @@ def test_img_cams(cam_name, target_layer, output_size, batch_size, mock_img_tens
("LayerCAM", "0.3", (1, 8, 16, 16)),
],
)
@pytest.mark.benchmark
def test_video_cams(cam_name, target_layer, output_size, mock_video_model, mock_video_tensor):
model = mock_video_model.eval()
# Hook the corresponding layer in the model
Expand Down
3 changes: 0 additions & 3 deletions tests/test_methods_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import pytest
from torchvision.models import mobilenet_v3_large, resnet18

from torchcam.methods import _utils


@pytest.mark.benchmark
def test_locate_candidate_layer(mock_img_model):
# ResNet-18
mod = resnet18().eval()
Expand All @@ -26,7 +24,6 @@ def test_locate_candidate_layer(mock_img_model):
assert mod.training


@pytest.mark.benchmark
def test_locate_linear_layer(mock_img_model):
# ResNet-18
mod = resnet18().eval()
Expand Down

0 comments on commit 7dcc0d4

Please sign in to comment.