What would you like to achieve?
You could also call train_loader.dataset.my_func(). Both ways should work though.
Ignite 16 provides some event handling like @trainer.on(Events.EPOCH_COMPLETED). Maybe the code would be cleaner, if you need a lot on these events.