(self)
| 93 | assert_allclose(result_loc, coord, type_test=True, device_test=True) |
| 94 | |
| 95 | def test_shape(self): |
| 96 | # test Iterable input data |
| 97 | test_dataset = iter(["vwxyz", "helloworld", "worldfoobar"]) |
| 98 | result = GridPatchDataset(data=test_dataset, patch_iter=identity_generator, with_coordinates=False) |
| 99 | output = [] |
| 100 | n_workers = 0 if sys.platform == "win32" else 2 |
| 101 | for item in DataLoader(result, batch_size=3, num_workers=n_workers): |
| 102 | output.append("".join(item)) |
| 103 | if sys.platform == "win32": |
| 104 | expected = ["ar", "ell", "ldf", "oob", "owo", "rld", "vwx", "wor", "yzh"] |
| 105 | else: |
| 106 | expected = ["d", "dfo", "hel", "low", "oba", "orl", "orl", "r", "vwx", "yzw"] |
| 107 | self.assertEqual(len("".join(expected)), len("".join(list(test_dataset)))) |
| 108 | self.assertEqual(sorted(output), sorted(expected)) |
| 109 | |
| 110 | def test_loading_array(self): |
| 111 | # test sequence input data with images |
nothing calls this directly
no test coverage detected