PyTorch callbacks

Is there an official callback feature in PyTorch? If not, I’d like to know the relevant files to modify to make it happen. Basically, I want callbacks for functions like on_batch_end(), on_epoch_end() etc.

Ignite has some nice callbacks.

1 Like

Thanks, @ptrblck. Is ITERATION_COMPLETED same as on_batch_end()?

I’m not sure, where on_batch_end() is defined, but based on the naming, it should be the same.

callbacks seems quite an useful thing, I google around see a lot of people implementing similar callback for PyTorch, is that a reason why PyTorch team think callback is not necessary? What’s the native solution if we do not use Callback?

Thanks.

1 Like