def make_batches(size, batch_size):
 nb_batch = int(np.ceil((size / float(batch_size))))
 return [((i * batch_size), min(size, ((i + 1) * batch_size))) for i in range(0, nb_batch)]

def make_batches ( size , batch_size ) : nb_batch = int ( np . ceil ( ( size / float ( batch_size ) ) ) ) return [ ( ( i * batch_size ) , min ( size , ( ( i + 1 ) * batch_size ) ) ) for i in range ( 0 , nb_batch ) ]
returns a list of batch indices .