def after_batch(self, stream_name: str, batch_data: Batch) -> None:
        """
        If ``stream_name`` equals to :py:attr:`cxflow.constants.TRAIN_STREAM`,
        increase the iterations counter and possibly stop the training; additionally, call :py:meth:`_check_train_time`.

        :param stream_name: stream name
        :param batch_data: ignored
        :raise TrainingTerminated: if the number of iterations reaches ``self._iters``
        """
        self._check_train_time()
        if self._iters is not None and stream_name == self._train_stream_name:
            self._iters_done += 1
            if self._iters_done >= self._iters:
                raise TrainingTerminated('Training terminated after iteration {}'.format(self._iters_done))
def after_batch ( self , stream_name : str , batch_data : Batch ) -> None : self . _check_train_time ( ) if self . _iters is not None and stream_name == self . _train_stream_name : self . _iters_done += 1 if self . _iters_done >= self . _iters : raise TrainingTerminated ( 'Training terminated after iteration {}' . format ( self . _iters_done ) )
If ``stream_name`` equals to :py:attr:`cxflow.constants.TRAIN_STREAM`,
        increase the iterations counter and possibly stop the training; additionally, call :py:meth:`_check_train_time`.

        :param stream_name: stream name
        :param batch_data: ignored
        :raise TrainingTerminated: if the number of iterations reaches ``self._iters``