Skip to content

Improve docs for Callbacks on access to all batch outputs #21069

@dudarboh

Description

@dudarboh

📚 Documentation

Hi Lightning team,

The docs encourage that the Callbacks should be "NON-ESSENTIAL logic that is NOT required for your lightning module".

However, in the example of accessing all batch outputs in on_train_epoch_end() docs, the clearing of the memory is done inside the callback, making it essential to avoid memory build-up.

It would be nice to adapt this example so that memory clean-up does not depend on the Callback.

I would assume it is as easy as moving memory-clearing code to the LightningModule's on_train_epoch_end(), however, I couldn't find any documentation of what is being called first, the LightningModule's on_train_epoch_end() or the Callbacks... Maybe I have missed it, but if not, then it would be another improvement to the docs.

Cheers

cc @lantiga @Borda

Metadata

Metadata

Assignees

Labels

docsDocumentation related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions