code: def test_torch_iteration(shutdown_only):
      # The object store is about 400MB.
      ctx = ray.init(num_cpus=1, object_store_memory=400e6)
      # The size of dataset is 500*(80*80*4)*8B, about 100MB.
      ds = ray.data.range_tensor(
          500, shape=(80, 80, 4), parallelism=100
      )
  
      # to_torch
      check_to_torch_no_spill(ctx, ds)
      # iter_torch_batches
      check_iter_torch_batches_no_spill(ctx, ds)
  
file_path: ray/python/ray/data/tests/test_object_gc.py
imports: import threading
  import pytest
  import ray
  from ray._private.internal_api import memory_summary
  from ray._private.test_utils import wait_for_condition
  from ray.tests.conftest import *
label_desc: Use image node_id 7 for calling a global function with example usage: test_torch_iteration(shutdown_only) without return types