Check the batch size of dataloader

Hi, i’m using the dynamic batch size (changing the batch size during training, and i implemented that by using the custom batch sampler, and partly fixing the pytorch’s dataloader code. plus, the method of my custom batch sampler is quite similar to pytorch’s Batchsampler), and i want to check whether actual batch size is changed or not.

in this case, what should i have to do? at first, i tried to check the batch size by printing like this code,


but in here, i checked that batch size isn’t change as i expected, but at the custom batch sampler, when i checked the batch size, it changed right as i expected

and sorry that i can’t attach the whole code of CustomBatchSamler because of the security, and if anyone want to see whole code for solving the problem, i can send it to your e-mail or any way you prefer

thanks a lot for your all response :slight_smile: