code: def save3x3(x, filename):
      numpy_device = chainer.get_device("@numpy")
      fig, ax = plt.subplots(3, 3, figsize=(9, 9), dpi=100)
      for ai, xi in zip(ax.flatten(), x):
          im = xi.reshape(28, 28)
          im = numpy_device.send(im)
          ai.imshow(im)
      fig.savefig(filename)
  
file_path: chainer/examples/vae/train_vae.py
imports: import argparse
  import os
  import warnings
  import matplotlib.pyplot
  import numpy
  import chainer
  from chainer import training
  from chainer.training import extensions
  import chainerx
  import net
  import matplotlib
label_desc: Use image node_id 2 for calling a global function with example usage: save3x3(x, filename) without return types