code: def test_torchscript_save_load_custom_filesystem(tmpdir, modelclass):
      """Test that scripted LightningModule is correctly saved and can be loaded with custom filesystems."""
      _DUMMY_PRFEIX = "dummy"
      _PREFIX_SEPARATOR = "://"
  
      class DummyFileSystem(LocalFileSystem):
          ...
  
      fsspec.register_implementation(
          _DUMMY_PRFEIX, DummyFileSystem, clobber=True
      )
  
      model = modelclass()
      output_file = os.path.join(
          _DUMMY_PRFEIX, _PREFIX_SEPARATOR, tmpdir, "model.pt"
      )
      script = model.to_torchscript(file_path=output_file)
  
      fs = get_filesystem(output_file)
      with fs.open(output_file, "rb") as f:
          loaded_script = torch.jit.load(f)
  
      assert torch.allclose(
          next(script.parameters()), next(loaded_script.parameters())
      )
  
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 8 for calling a global function with example usage: test_torchscript_save_load_custom_filesystem(tmpdir, modelclass) without return types