MCPcopy Create free account
hub / github.com/OpenSparseLLMs/Linear-MoE / __len__

Method __len__

linear_moe/data/llama.py:264–267  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

262 data_cache_path=None)
263
264 def __len__(self):
265 # -1 is due to data structure used to retieve the index:
266 # sample i --> [sample_idx[i], sample_idx[i+1])
267 return self.sample_idx.shape[0] - 1
268
269 def __getitem__(self, idx):
270 # Get the shuffled index.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected