code: def get_data_loader(
      data_dir,
      batch_size,
      num_workers,
      input_size,
      crop_ratio,
      train_dataset=None,
      val_dataset=None,
  ):
      normalize = transforms.Normalize(
          [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]
      )
      jitter_param = 0.4
      lighting_param = 0.1
      crop_ratio = crop_ratio if crop_ratio > 0 else 0.875
      resize = int(math.ceil(input_size / crop_ratio))
  
      transform_train = transforms.Compose(
          [
              transforms.RandomResizedCrop(input_size),
              transforms.RandomFlipLeftRight(),
              transforms.RandomColorJitter(
                  brightness=jitter_param,
                  contrast=jitter_param,
                  saturation=jitter_param,
              ),
              transforms.RandomLighting(lighting_param),
              transforms.ToTensor(),
              normalize,
          ]
      )
      transform_test = transforms.Compose(
          [
              transforms.Resize(resize, keep_ratio=True),
              transforms.CenterCrop(input_size),
              transforms.ToTensor(),
              normalize,
          ]
      )
  
      if not train_dataset:
          train_dataset = imagenet.classification.ImageNet(
              data_dir, train=True
          )
      if not val_dataset:
          val_dataset = imagenet.classification.ImageNet(
              data_dir, train=False
          )
  
      train_data = gluon.data.DataLoader(
          train_dataset.transform_first(transform_train),
          batch_size=batch_size,
          shuffle=True,
          last_batch="discard",
          num_workers=num_workers,
      )
      val_data = gluon.data.DataLoader(
          val_dataset.transform_first(transform_test),
          batch_size=batch_size,
          shuffle=False,
          num_workers=num_workers,
      )
  
      return train_data, val_data, loader_batch_fn
  
file_path: gluon-cv/gluoncv/auto/estimators/image_classification/utils.py
imports: import os
  import math
  import mxnet
  from mxnet import nd
  from mxnet import gluon
  from mxnet.gluon.data.vision import transforms
  from ....data import imagenet
label_desc: Use image node_id 4 for calling a global function with example usage: get_data_loader(data_dir, batch_size, num_workers, input_size, crop_ratio, train_dataset, val_dataset) and returns: train_data,  val_data,  loader_batch_fn