code: def create_dataloaders():
      train_transform = transforms.Compose(
          [
              transforms.Resize(256),
              transforms.RandomCrop(224),
              transforms.RandomHorizontalFlip(),
              transforms.ColorJitter(brightness=0.5, hue=0.3),
              transforms.ToTensor(),
              transforms.Normalize(
                  [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]
              ),
          ]
      )
      val_transform = transforms.Compose(
          [
              transforms.Resize(256),
              transforms.CenterCrop(224),
              transforms.ToTensor(),
              transforms.Normalize(
                  [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]
              ),
          ]
      )
  
      # Apply data augmentation to the tarin_dataset
      train_dataset = OxfordIIITPet(
          root="/tmp/data", transform=train_transform, download=True
      )
      val_dataset = OxfordIIITPet(
          root="/tmp/data", transform=val_transform
      )
  
      # obtain training indices that will be used for validation
      indices = torch.randperm(len(train_dataset))
      val_size = len(train_dataset) // 4
      train_dataset = torch.utils.data.Subset(
          train_dataset, indices[:-val_size]
      )
      val_dataset = torch.utils.data.Subset(
          val_dataset, indices[-val_size:]
      )
  
      # prepare data loaders
      train_dataloader = DataLoader(train_dataset, batch_size=32)
      val_dataloader = DataLoader(val_dataset, batch_size=32)
  
      return train_dataloader, val_dataloader
  
file_path: BigDL/python/nano/tutorial/training/pytorch/pytorch_train_ipex_decorator.py
imports: import torch
  from torch import nn
  from torch.utils.data import DataLoader
  from torchvision import transforms
  from torchvision.models import resnet18
  from torchvision.datasets import OxfordIIITPet
  from tqdm import tqdm
  from bigdl.nano.pytorch import nano
label_desc: Use image node_id 1 for calling a global function with example usage: create_dataloaders() and returns: train_dataloader,  val_dataloader