osc.utils.batches_per_epoch

batches_per_epoch(num_samples, batch_size, drop_last)[source]

Compute the number of batches in one epoch according to batch size and drop behavior.

Parameters
  • num_samples (int) –

  • batch_size (int) –

  • drop_last (bool) –

Return type

int

Returns

The number of batches.