MCPcopy
hub / github.com/nitrain/nitrain / test_3d_channels_first

Method test_3d_channels_first

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

Source from the content-addressed store, hash-verified

128 self.assertEqual(x_batch.shape, (4, 182, 218, 182, 1))
129
130 def test_3d_channels_first(self):
131 loader = nt.Loader(self.dataset_3d, images_per_batch=4,
132 channels_first=True)
133
134 x_batch, y_batch = next(iter(loader))
135 self.assertTrue(x_batch.shape == (4, 1, 182, 218, 182))
136
137 loader2 = loader.to_keras()
138 x_batch, y_batch = next(iter(loader2))
139 self.assertTrue(x_batch.shape == (4, 1, 182, 218, 182))
140
141 gen = record_generator(loader)
142 xb,yb = next(iter(gen))
143
144 def test_3d_no_expand(self):
145 loader = nt.Loader(self.dataset_3d, images_per_batch=4,

Callers

nothing calls this directly

Calls 2

to_kerasMethod · 0.95
record_generatorFunction · 0.90

Tested by

no test coverage detected