code: def on_batch_end(self, net, **kwargs):
      side_effects.append(
          (
              torch.cuda.memory_allocated() / 1e6,
              torch.cuda.memory_cached() / 1e6,
          )
      )
  
file_path: skorch/examples/benchmarks/history.py
imports: from pprint import pprint
  import time
  import numpy
  from sklearn.datasets import make_classification
  import torch
  from skorch import NeuralNetClassifier
  from skorch.callbacks import Callback
  from skorch.toy import make_classifier
label_desc: Use image node_id 1 for calling the PrintMemory obj's underlying member method code with example usage: obj.on_batch_end(net) without return types