code: def run_torch():
      from torch.utils.data import DataLoader, TensorDataset
  
      from ray.train.torch import (
          get_device,
          prepare_data_loader,
          prepare_model,
      )
  
      def train_func():
          # Create dummy model and data loader
          model = torch.nn.Linear(10, 10)
          inputs, targets = torch.randn(128, 10), torch.randn(128, 1)
          dataloader = DataLoader(
              TensorDataset(inputs, targets), batch_size=32
          )
  
          # Test Torch Utilities
          prepare_data_loader(dataloader)
          prepare_model(model)
          get_device()
  
      trainer = TorchTrainer(
          train_func,
          scaling_config=ScalingConfig(num_workers=2, use_gpu=False),
      )
      trainer.fit()
  
file_path: ray/python/ray/train/tests/test_train_usage.py
imports: import pytest
  import torch
  import ray
  from ray.train import ScalingConfig
  from ray.train.torch import TorchTrainer
label_desc: Use image node_id 2 for calling a global function with example usage: run_torch() without return types