MCPcopy Create free account
hub / github.com/geekcomputers/Python / __len__

Method __len__

ML/src/python/neuralforge/data/dataset.py:46–47  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 self.samples.append((img_path, class_idx))
45
46 def __len__(self) -> int:
47 return len(self.samples)
48
49 def __getitem__(self, idx: int) -> Tuple[torch.Tensor, int]:
50 img_path, label = self.samples[idx]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected