def iter_chunksize(num_samples, chunksize):
last_chunksize = int(np.mod(num_samples, chunksize))<EOL>chunksize = int(chunksize)<EOL>for _ in range(int(num_samples) // chunksize):<EOL><INDENT>yield chunksize<EOL><DEDENT>if last_chunksize > <NUM_LIT:0>:<EOL><INDENT>yield last_chunksize<EOL><DEDENT>
Iterator used to iterate in chunks over an array of size `num_samples`.
    At each iteration returns `chunksize` except for the last iteration.