Computing number of batches in one epoch
The double-slash in python stands for “floor” division (rounds down to nearest whole number), so if the result is not an integer, it will always miss the last batch, which is smaller than the batch size.

For example:

Given a dataset of 10,000 samples and batch size of 15:

# Original calculation:
# (10000 + 15 - 1) // 15 = floor(667.6) = 667

# Your calculation:
# 10000 // 15 = floor(666.667) = 666


Your formula calculates number of full batches, theirs total number of batches.