'Given a number of examples, E, and a batch_size, B, generate indices
[0, 1, 2, ... B-1;
[B, B+1, ... 2*B-1;
returning those indices as a 2-dim tensor shaped like E/B x B.  Note that
shape is only correct if E % B == 0.  If not, then an extra row is generated
so that the remainder of examples is included. The extra examples are
explicitly to to the zero index (see randomize_example_idxs_mod_batch_size)
for randomized behavior.
Args:
nexamples: The number of examples to batch up.
batch_size: The size of the batch.
Returns:
2-dim tensor as described above.'

@staticmethod
def example_idxs_mod_batch_size(nexamples, batch_size):

    bmrem = (batch_size - (nexamples % batch_size))
    bmrem_examples = []
    if (bmrem < batch_size):
        ridxs = np.random.permutation(nexamples)[0:bmrem].astype(np.int32)
        bmrem_examples = np.sort(ridxs)
    example_idxs = (range(nexamples) + list(bmrem_examples))
    example_idxs_e_x_edivb = np.reshape(example_idxs, [(-1), batch_size])
    return (example_idxs_e_x_edivb, bmrem)
