class_docstr: Create a simple callback on the fly using lambda functions.
  
  Args:
      **kwargs: hooks supported by :class:`~lightning.pytorch.callbacks.callback.Callback`
  
  Example::
  
      >>> from lightning.pytorch import Trainer
      >>> from lightning.pytorch.callbacks import LambdaCallback
      >>> trainer = Trainer(callbacks=[LambdaCallback(setup=lambda *args: print('setup'))])
class_docstr_tok: ["Create","a","simple","callback","on","the","fly","using","lambda","functions",".","Args",":","*","*","kwargs",":","hooks","supported","by",":","class",":","`","~lightning.pytorch.callbacks.callback.Callback","`","Example",":",":",">",">",">","from","lightning.pytorch","import","Trainer",">",">",">","from","lightning.pytorch.callbacks","import","LambdaCallback",">",">",">","trainer","=","Trainer","(","callbacks=","[","LambdaCallback","(","setup=lambda","*","args",":","print","(","'setup","'",")",")","]",")"]
code: def __init__(
      self,
      setup: Optional[Callable] = None,
      teardown: Optional[Callable] = None,
      on_fit_start: Optional[Callable] = None,
      on_fit_end: Optional[Callable] = None,
      on_sanity_check_start: Optional[Callable] = None,
      on_sanity_check_end: Optional[Callable] = None,
      on_train_batch_start: Optional[Callable] = None,
      on_train_batch_end: Optional[Callable] = None,
      on_train_epoch_start: Optional[Callable] = None,
      on_train_epoch_end: Optional[Callable] = None,
      on_validation_epoch_start: Optional[Callable] = None,
      on_validation_epoch_end: Optional[Callable] = None,
      on_test_epoch_start: Optional[Callable] = None,
      on_test_epoch_end: Optional[Callable] = None,
      on_validation_batch_start: Optional[Callable] = None,
      on_validation_batch_end: Optional[Callable] = None,
      on_test_batch_start: Optional[Callable] = None,
      on_test_batch_end: Optional[Callable] = None,
      on_train_start: Optional[Callable] = None,
      on_train_end: Optional[Callable] = None,
      on_validation_start: Optional[Callable] = None,
      on_validation_end: Optional[Callable] = None,
      on_test_start: Optional[Callable] = None,
      on_test_end: Optional[Callable] = None,
      on_exception: Optional[Callable] = None,
      on_save_checkpoint: Optional[Callable] = None,
      on_load_checkpoint: Optional[Callable] = None,
      on_before_backward: Optional[Callable] = None,
      on_after_backward: Optional[Callable] = None,
      on_before_optimizer_step: Optional[Callable] = None,
      on_before_zero_grad: Optional[Callable] = None,
      on_predict_start: Optional[Callable] = None,
      on_predict_end: Optional[Callable] = None,
      on_predict_batch_start: Optional[Callable] = None,
      on_predict_batch_end: Optional[Callable] = None,
      on_predict_epoch_start: Optional[Callable] = None,
      on_predict_epoch_end: Optional[Callable] = None,
  ):
      for k, v in locals().items():
          if k == "self":
              continue
          if v is not None:
              setattr(self, k, v)
  
imports: from typing import Callable, Optional
  from lightning.pytorch.callbacks.callback import Callback
label_desc: Use image node_id 1 to create a new LambdaCallback object from inherited base classes: Callback with example: obj = LambdaCallback(setup, teardown, on_fit_start, on_fit_end, on_sanity_check_start, on_sanity_check_end, on_train_batch_start, on_train_batch_end, on_train_epoch_start, on_train_epoch_end, on_validation_epoch_start, on_validation_epoch_end, on_test_epoch_start, on_test_epoch_end, on_validation_batch_start, on_validation_batch_end, on_test_batch_start, on_test_batch_end, on_train_start, on_train_end, on_validation_start, on_validation_end, on_test_start, on_test_end, on_exception, on_save_checkpoint, on_load_checkpoint, on_before_backward, on_after_backward, on_before_optimizer_step, on_before_zero_grad, on_predict_start, on_predict_end, on_predict_batch_start, on_predict_batch_end, on_predict_epoch_start, on_predict_epoch_end)