code: def create_data_loader(root_dir, batch_size):
      dir_path = os.path.realpath(root_dir)
      data_transform = transforms.Compose(
          [
              transforms.Resize(256),
              transforms.ColorJitter(),
              transforms.RandomCrop(224),
              transforms.RandomHorizontalFlip(),
              transforms.Resize(128),
              transforms.ToTensor(),
          ]
      )
  
      catdogs = ImageFolder(dir_path, data_transform)
      val_num = len(catdogs) // 10
      train_num = len(catdogs) - val_num
      train_set, val_set = torch.utils.data.random_split(
          catdogs, [train_num, val_num]
      )
  
      train_loader = DataLoader(
          train_set, batch_size=batch_size, shuffle=True, num_workers=0
      )
      val_loader = DataLoader(
          val_set, batch_size=batch_size, shuffle=False, num_workers=0
      )
      return train_loader, val_loader
  
file_path: BigDL/python/nano/test/pytorch/utils/_train_imagefolder.py
imports: import os
  import torch
  from bigdl.nano.pytorch.vision.datasets import ImageFolder
  from bigdl.nano.pytorch.vision.transforms import transforms
  import pytorch_lightning
  from torch.utils.data import DataLoader
  from bigdl.nano.pytorch.vision.models import ImageClassifier
label_desc: Use image node_id 1 for calling a global function with example usage: create_data_loader(root_dir, batch_size) and returns: train_loader,  val_loader