Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.

nidl.callbacks.BatchTypingCallback

class nidl.callbacks.BatchTypingCallback(*, only_first_batch=True)[source]

Bases: Callback

Check the batch format based on LightningModule step signatures.

Raises:
TypeError

If function parameters are not annotated or batch doesn’t match.

__init__(*, only_first_batch=True)[source]
on_predict_batch_start(trainer, pl_module, batch, batch_idx, dataloader_idx=0)[source]

Called when the predict batch begins.

on_test_batch_start(trainer, pl_module, batch, batch_idx, dataloader_idx=0)[source]

Called when the test batch begins.

on_train_batch_start(trainer, pl_module, batch, batch_idx)[source]

Called when the train batch begins.

on_validation_batch_start(trainer, pl_module, batch, batch_idx, dataloader_idx=0)[source]

Called when the validation batch begins.