MCPcopy Create free account
hub / github.com/kyegomez/BitNet / __getitem__

Method __getitem__

train.py:61–64  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

59 self.seq_len = seq_len
60
61 def __getitem__(self, index):
62 rand_start = torch.randint(0, self.data.size(0) - self.seq_len, (1,))
63 full_seq = self.data[rand_start : rand_start + self.seq_len + 1].long()
64 return full_seq
65
66 def __len__(self):
67 return self.data.size(0) // self.seq_len

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected