MCPcopy Create free account
hub / github.com/intel/neural-compressor / __len__

Method __len__

neural_compressor/tensorflow/utils/data.py:224–229  ·  view source on GitHub ↗

Return the number of batches.

(self)

Source from the content-addressed store, hash-verified

222 yield batch
223
224 def __len__(self):
225 """Return the number of batches."""
226 if self.drop_last:
227 return len(self.sampler) // self.batch_size
228 else:
229 return (len(self.sampler) + self.batch_size - 1) // self.batch_size
230
231
232class BaseDataLoader:

Callers 1

__len__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected