<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def after_batch(self, stream_name: str, batch_data) -> None: """ If initialized to check after each batch, stop the training once the batch data contains a monitored variable equal to NaN. :param stream_name: name of the stream to be checked :param batch_data: batch data to be checked """


        if self._after_batch:
            self._check_nan({stream_name: batch_data})