code: def get_caltech101_iterator(batch_size, num_workers, dtype):
      def transform(image, label):
          # resize the shorter edge to 224, the longer edge will be greater or equal to 224
          resized = mx.image.resize_short(image, 224)
          # center and crop an area of size (224,224)
          cropped, crop_info = mx.image.center_crop(resized, (224, 224))
          # transpose the channels to be (3,224,224)
          transposed = mx.nd.transpose(cropped, (2, 0, 1))
          return transposed, label
  
      training_path, testing_path = get_caltech101_data()
      dataset_train = ImageFolderDataset(root=training_path).transform(
          transform
      )
      dataset_test = ImageFolderDataset(root=testing_path).transform(
          transform
      )
  
      train_data = DataLoader(
          dataset_train,
          batch_size,
          shuffle=True,
          num_workers=num_workers,
      )
      test_data = DataLoader(
          dataset_test,
          batch_size,
          shuffle=False,
          num_workers=num_workers,
      )
      return DataLoaderIter(train_data), DataLoaderIter(test_data)
  
imports: import os
  import random
  import tarfile
  import logging
  import tarfile
  import mxnet
  from mxnet.test_utils import get_cifar10
  from mxnet.gluon.data.vision import ImageFolderDataset
  from mxnet.gluon.data import DataLoader
  from mxnet.contrib.io import DataLoaderIter
label_desc: Use image node_id 5 for calling a global function with example usage: get_caltech101_iterator(batch_size, num_workers, dtype) and returns: DataLoaderIter,  DataLoaderIter, transposed,  label