Suppose the training dataset is [1,2,3,4,5] and I'd like to duplicate each sample for a number of times. Let's assume the number is 3 and is the same for all samples, then the result after duplication is: [1,1,1,2,2,2,3,3,3,4,4,4,5,5,5].
But the result that the official tf.data.Dataset.repeat function gives is [1,2,3,4,5,1,2,3,4,5,1,2,3,4,5], which does not meet my needs.
How can I implement the duplication and what if the duplication number for each sample is different (for example duplicate each sample[i] for 'weights[i]' times)