MCPcopy
hub / github.com/nitrain/nitrain / __call__

Method __call__

nitrain/samplers/slice.py:17–33  ·  view source on GitHub ↗
(self, x, y)

Source from the content-addressed store, hash-verified

15 self.shuffle = shuffle
16
17 def __call__(self, x, y):
18 # create slices of all images
19 self.x = create_slices(x, self.axis)
20 self.y = create_slices(y, self.axis)
21
22 xx = self.x[0]
23 if isinstance(xx, list):
24 while isinstance(xx, list):
25 batch_length = len(xx)
26 xx = xx[0]
27 else:
28 batch_length = len(self.x)
29
30 self.batch_length = batch_length
31 self.n_batches = math.ceil(batch_length / self.batch_size)
32
33 return self
34
35 def __iter__(self):
36 """

Callers

nothing calls this directly

Calls 1

create_slicesFunction · 0.85

Tested by

no test coverage detected