code: def torch_fashion_mnist(num_workers, use_gpu, num_samples):
      trainer = TorchTrainer(
          fashion_mnist_train_func,
          scaling_config=ScalingConfig(
              num_workers=num_workers, use_gpu=use_gpu
          ),
      )
      tuner = Tuner(
          trainer,
          param_space={
              "train_loop_config": {
                  "lr": tune.loguniform(1e-4, 1e-1),
                  "batch_size_per_worker": tune.choice([32, 64, 128]),
                  "epochs": 2,
              }
          },
          tune_config=TuneConfig(
              num_samples=num_samples,
          ),
      )
      analysis = tuner.fit()._experiment_analysis
  
      # Check that loss decreases in each trial.
      for df in analysis.trial_dataframes.values():
          assert df.loc[1, "loss"] < df.loc[0, "loss"]
  
imports: import logging
  import pytest
  import ray
  from ray import train, tune
  from ray.air.constants import TRAINING_ITERATION
  from ray.train import FailureConfig, RunConfig, ScalingConfig
  from ray.train._internal.worker_group import WorkerGroup
  from ray.train.backend import Backend, BackendConfig
  from ray.train.data_parallel_trainer import DataParallelTrainer
  from ray.train.examples.pytorch.torch_fashion_mnist_example import train_func_per_worker
  from ray.train.examples.tf.tensorflow_mnist_example import train_func
  from ray.train.tensorflow.tensorflow_trainer import TensorflowTrainer
  from ray.train.tests.util import create_dict_checkpoint, load_dict_checkpoint
  from ray.train.torch.torch_trainer import TorchTrainer
  from ray.tune.tune_config import TuneConfig
  from ray.tune.tuner import Tuner
label_desc: Use image node_id 3 for calling a global function with example usage: torch_fashion_mnist(num_workers, use_gpu, num_samples) without return types