Sunnydreamrain:

“use the individual batch statistics for the validation (during the training process), and to obtain the statistics over the dataset in the end of the training”


I don’t really understand this question.
You would like to use individual batch statistics during the validation while use the running stats during training?
If you set the model to .eval(), the running stats will be used, if track_running_stats=True. Otherwise the batch stats will be used.
Do you want the running average of the dataset statistics or the “global” stats?
If the latter, you could calculate them offline and just set the running stats to these values.