def _check_finite(self, loss: torch.Tensor) -> None:
    if (not torch.isfinite(loss).all()):
        raise ValueError(f'The loss returned in `training_step` is {loss}.')
    model = self.trainer.lightning_module
    detect_nan_parameters(model)
def _check_finite(self, loss: torch.Tensor) -> None:
    if (not torch.isfinite(loss).all()):
        raise ValueError(f'The loss returned in `training_step` is {loss}.')
    model = self.trainer.lightning_module
    detect_nan_parameters(model)