code: def test_torch_trainer_crash(ray_start_10_cpus_shared):
      from ray import train
      from ray.train import ScalingConfig
      from ray.train.torch import TorchTrainer
  
      ray.data.DataContext.get_current().execution_options.verbose_progress = (
          True
      )
  
      train_ds = ray.data.range_tensor(100)
      train_ds = train_ds.materialize()
  
      def train_loop_per_worker():
          it = train.get_dataset_shard("train")
          for i in range(2):
              count = 0
              for batch in it.iter_batches():
                  count += len(batch["data"])
              assert count == 50
  
      my_trainer = TorchTrainer(
          train_loop_per_worker,
          scaling_config=ScalingConfig(num_workers=2),
          datasets={"train": train_ds},
      )
      my_trainer.fit()
  
file_path: ray/python/ray/data/tests/test_torch.py
imports: import numpy
  import pandas
  import pytest
  import ray
  from ray.data.extensions.tensor_extension import TensorArray
  from ray.data.tests.conftest import *
  from ray.tests.conftest import *
label_desc: Use image node_id 8 for calling a global function with example usage: test_torch_trainer_crash(ray_start_10_cpus_shared) without return types