code: def resize_dataset(x, image_size):
      num_data = x.shape[0]
      dim = x.shape[1]
      X = np.zeros(
          shape=(num_data, dim, image_size, image_size),
          dtype=np.float32,
      )
      for n in range(0, num_data):
          for d in range(0, dim):
              X[n, d, :, :] = np.array(
                  Image.fromarray(x[n, d, :, :]).resize(
                      (image_size, image_size), Image.BILINEAR
                  ),
                  dtype=np.float32,
              )
      return X
  
file_path: singa/examples/cnn/train_cnn.py
imports: from singa import singa_wrap
  from singa import device
  from singa import tensor
  from singa import opt
  import numpy
  import time
  import argparse
  from PIL import Image
label_desc: Use image node_id 5 for calling a global function with example usage: resize_dataset(x, image_size) and returns: X