Skip to content
Discussion options

You must be logged in to vote

You can use any of the following if done inside the LightningModule:

batch = self.on_before_batch_transfer(batch, dataloader_idx)
batch = self.transfer_batch_to_device(batch, device)
batch = self.on_after_batch_transfer(batch, dataloader_idx)

If you really need to do it in the Callback, I guess you could use on_train_batch_start since the modification is in-place. But I wouldn't recommend it.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by carmocca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment