code: def make_data_loader(
      args, mode, is_consistent=False, synthetic=False
  ):
      assert mode in ("train", "validation")
  
      if mode == "train":
          total_batch_size = args.batch_size * flow.env.get_world_size()
          batch_size = args.batch_size
          num_samples = args.num_image
      else:
          total_batch_size = args.val_global_batch_size
          batch_size = args.val_batch_size
          num_samples = args.val_samples_per_epoch
  
      placement = None
      sbp = None
  
      if is_consistent:
          placement = flow.env.all_device_placement("cpu")
          sbp = flow.sbp.split(0)
          batch_size = total_batch_size
  
      if synthetic:
          data_loader = SyntheticDataLoader(
              batch_size=batch_size,
              num_classes=args.num_classes,
              placement=placement,
              sbp=sbp,
          )
          return data_loader.to("cuda")
  
      ofrecord_data_loader = OFRecordDataLoader(
          ofrecord_root=args.ofrecord_path,
          mode=mode,
          dataset_size=num_samples,
          batch_size=batch_size,
          total_batch_size=total_batch_size,
          data_part_num=args.ofrecord_part_num,
          placement=placement,
          sbp=sbp,
      )
      return ofrecord_data_loader
  
imports: import oneflow
  from oneflow.nn.parallel import DistributedDataParallel
  from utils.ofrecord_data_utils import OFRecordDataLoader, SyntheticDataLoader
  from utils.utils_logging import AverageMeter
  from utils.utils_callbacks import CallBackVerification, CallBackLogging, CallBackModelCheckpoint
  from backbones import get_model
  from graph import TrainGraph, EvalGraph
  from utils.losses import CrossEntropyLoss_sbp
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: make_data_loader(args, mode, is_consistent, synthetic) and returns: ofrecord_data_loader, data_loader