Skip to content

Commit b824e46

Browse files
authored
Deleted indivual usps test
1 parent 076a32a commit b824e46

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

tests/test_dataloaders.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -38,40 +38,3 @@ def test_load_data(data_name, expected):
3838
) # Should probably restrict this to only int or one-hot encoded tensor or array for consistency.
3939

4040

41-
def test_uspsdataset0_6():
42-
from tempfile import TemporaryDirectory
43-
44-
import h5py
45-
import numpy as np
46-
from torchvision import transforms
47-
48-
# Create a temporary directory (deleted after the test)
49-
with TemporaryDirectory() as tempdir:
50-
tempdir = Path(tempdir)
51-
52-
tf = tempdir / "usps.h5"
53-
54-
# Create a h5 file
55-
with h5py.File(tf, "w") as f:
56-
targets = np.array([6, 5, 4, 3, 2, 1, 0, 0, 0, 0])
57-
indices = np.arange(len(targets))
58-
# Populate the file with data
59-
f["train/data"] = np.random.rand(10, 16 * 16)
60-
f["train/target"] = targets
61-
62-
trans = transforms.Compose(
63-
[
64-
transforms.Resize((16, 16)),
65-
transforms.ToTensor(),
66-
]
67-
)
68-
dataset = USPSDataset0_6(
69-
data_path=tempdir,
70-
sample_ids=indices,
71-
train=True,
72-
transform=trans,
73-
)
74-
assert len(dataset) == 10
75-
data, target = dataset[0]
76-
assert data.shape == (1, 16, 16)
77-
assert target == 6

0 commit comments

Comments
 (0)