def num_sanity_val_batches(self) -> list[Union[int, float]]:
        """The number of validation batches that will be used during the sanity-checking part of ``trainer.fit()``."""
        max_batches = self.fit_loop.epoch_loop.val_loop.max_batches
        # re-compute the `min` in case this is called outside the sanity-checking stage
        return [min(self.num_sanity_val_steps, batches) for batches in max_batches]
The number of validation batches that will be used during the sanity-checking part of ``trainer.fit()``.
src/lightning/pytorch/trainer/trainer.py