MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / get_num_batch

Method get_num_batch

datasets/sampler.py:241–248  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

239 return bucket_sample_dict
240
241 def get_num_batch(self) -> int:
242 bucket_sample_dict = self.group_by_bucket()
243 self._get_num_batch_cached_bucket_sample_dict = bucket_sample_dict
244
245 # calculate the number of batches
246 if self.verbose:
247 self._print_bucket_info(bucket_sample_dict)
248 return self.approximate_num_batch
249
250 def _print_bucket_info(self, bucket_sample_dict: dict) -> None:
251 # collect statistics

Callers 1

__len__Method · 0.95

Calls 2

group_by_bucketMethod · 0.95
_print_bucket_infoMethod · 0.95

Tested by

no test coverage detected