How configure the size of dataset?


I was running GNMTv2 using pytorch. But I just want to check the 1 iteration time(Forward ~ Optimize). Now If data was loaded, It automatically grabs the size of dataset and it runs many times.

I want to know how can I change the dataset size.

Thanks for reading this.

The length of a Dataset is defined in it’s __len__() method and you could override it with a custom method returning your desired length or alternatively implement a new custom Dataset with the desired length.

@ptrblck Thanks to helping me.