Skip to content

Commit

Permalink
removing unused variables in test_models.py in TestNaive class resolv…
Browse files Browse the repository at this point in the history
…ing F841
  • Loading branch information
hmd101 committed Oct 16, 2024
1 parent 38ac6c3 commit 23d5523
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
5 changes: 1 addition & 4 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,14 +296,11 @@ def test_kernel_size(self, mdl, einstein_img):
@pytest.mark.parametrize("mdl", ["naive.Gaussian", "naive.CenterSurround"])
@pytest.mark.parametrize("cache_filt", [False, True])
def test_cache_filt(self, cache_filt, mdl):
img = torch.ones(1, 1, 100, 100).to(DEVICE).requires_grad_()
if mdl == "naive.Gaussian":
model = po.simul.Gaussian((31, 31), 1.0, cache_filt=cache_filt).to(DEVICE)
elif mdl == "naive.CenterSurround":
model = po.simul.CenterSurround((31, 31), cache_filt=cache_filt).to(DEVICE)

y = model(img) # forward pass should cache filt if True

if cache_filt:
assert model._filt is not None
else:
Expand All @@ -319,7 +316,7 @@ def test_CenterSurround_channels(self, center_std, out_channels, on_center):
(31, 31), center_std=center_std, out_channels=out_channels
)
else:
model = po.simul.CenterSurround(
model = po.simul.CenterSurround( # noqa: F841
(31, 31), center_std=center_std, out_channels=out_channels
)

Expand Down
1 change: 0 additions & 1 deletion tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def test_stats(self):
assert (
torch.abs(v - torch.var(x, dim=1, keepdim=True, unbiased=False)) < 1e-5
).all()
s = po.tools.skew(x, mean=m, var=v, dim=1)
k = po.tools.kurtosis(x, mean=m, var=v, dim=1)
assert torch.abs(k.mean() - 3) < 1e-1

Expand Down

0 comments on commit 23d5523

Please sign in to comment.