Skip to content

Commit

Permalink
Added test for cutouts.
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoOinonen committed Nov 24, 2023
1 parent bd901e4 commit abf3e65
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,14 @@ def test_interpolate_and_crop():

assert len(X) == 1
assert X[0].shape == (2, 10, 10, 10)


def test_add_cutout():
from mlspm.preprocessing import add_cutout

np.random.seed(0)

for _ in range(100):
test_input = np.ones((3, 32, 32, 32))
add_cutout([test_input], n_holes=10)
assert np.isclose(test_input, 0.0).any()

0 comments on commit abf3e65

Please sign in to comment.