def on_batch_end(self, runner: "IRunner"):
        """Batch end hook.

        Args:
            runner: current runner
        """
        inputs, targets = (
            runner.batch[self.input_key].detach(),
            runner.batch[self.target_key].detach(),
        )
        self.confusion_matrix.update(predictions=inputs, targets=targets)
Batch end hook.

        Args:
            runner: current runner
        
catalyst/callbacks/metrics/confusion_matrix.py