MCPcopy Create free account
hub / github.com/pytorch/examples / __len__

Method __len__

distributed/ddp-tutorial-series/datautils.py:9–10  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7 self.data = [(torch.rand(20), torch.rand(1)) for _ in range(size)]
8
9 def __len__(self):
10 return self.size
11
12 def __getitem__(self, index):
13 return self.data[index]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected