code: def test_torchscript_device(device_str):
      """Test that scripted module is on the correct device."""
      device = torch.device(device_str)
      model = BoringModel().to(device)
      model.example_input_array = torch.randn(5, 32)
  
      script = model.to_torchscript()
      assert next(script.parameters()).device == device
      script_output = script(model.example_input_array.to(device))
      assert script_output.device == device
  
imports: import os
  import fsspec
  import pytest
  import torch
  from fsspec.implementations.local import LocalFileSystem
  from lightning.fabric.utilities.cloud_io import get_filesystem
  from lightning.pytorch.core.module import LightningModule
  from lightning.pytorch.demos.boring_classes import BoringModel
  from tests_pytorch.helpers.advanced_models import BasicGAN, ParityModuleRNN
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 4 for calling a global function with example usage: test_torchscript_device(device_str) without return types