code: def train_loop_per_worker():
      # Get an iterator to the dataset we passed in below.
      it = train.get_dataset_shard("train")
  
      # Train for 10 epochs over the data. We'll use a shuffle buffer size
      # of 10k elements, and prefetch up to 10 batches of size 128 each.
      for _ in range(10):
          for batch in it.iter_batches(
              local_shuffle_buffer_size=10000,
              batch_size=128,
              prefetch_batches=10,
          ):
              print("Do some training on batch", batch)
  
file_path: ray/doc/source/train/doc_code/data_ingest_torch_new.py
imports: import ray
  from ray import train
  from ray.train import ScalingConfig
  from ray.train.torch import TorchTrainer
  import numpy
  from typing import Dict
  from ray.train import DataConfig
  from typing import Optional, Dict, List
  from ray.data import Dataset, DataIterator, NodeIdStr
  from ray.actor import ActorHandle
label_desc: Use image node_id 2 for calling a global function with example usage: train_loop_per_worker() without return types