function makeBatches(size, batchSize) {
	  var output = [];
	  var batchStart = 0;
	  var batchEnd = null;

	  while (batchStart < size) {
	    batchEnd = batchStart + batchSize;

	    if (batchEnd >= size) {
	      batchEnd = size;
	    }

	    output.push([batchStart, batchEnd]);
	    batchStart = batchEnd;
	  }

	  return output;
	}
Returns a list of batch indices (tuples of indices).
@param size: Integer, total size of the data to slice into batches.
@param batchSize: Integer, batch size.
@returns An Array of [batchStart, batchEnd] tuples. batchStart is
  inclusive; batchEnd is exclusive. I.e., each batch consists of indices x
  that satisfy batchStart <= x < batchEnd.