MCPcopy
hub / github.com/nitrain/nitrain / test_copy

Method test_copy

tests/test_loaders.py:75–90  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73 xb,yb = next(iter(gen))
74
75 def test_copy(self):
76 import ants
77 import nitrain as nt
78 img = ants.image_read(ants.get_data('r16'))
79
80 x = [img for _ in range(100)]
81 y = list(range(100))
82
83 dataset = nt.Dataset(x, y)
84 # test copy
85 ds_train, ds_test = dataset.split(0.8)
86 loader_train = nt.Loader(ds_train, images_per_batch=12)
87 loader_test = loader_train.copy(ds_test)
88 self.assertEqual(loader_test.images_per_batch, loader_train.images_per_batch)
89
90 loader_test = loader_train.copy(ds_test, drop_transforms=True)
91
92 def test_to_keras(self):
93 loader = nt.Loader(self.dataset_2d, images_per_batch=4)

Callers

nothing calls this directly

Calls 2

splitMethod · 0.95
copyMethod · 0.95

Tested by

no test coverage detected