code: def test_valid_submodules():
      mod, mod2, mod3, mod4 = (
          get_cuda_mod(),
          get_cuda_mod(),
          get_cuda_mod(),
          get_cuda_mod(),
      )
  
      # Create the nested cuda module
      mod.import_module(mod2)
      mod2.import_module(mod3)
      mod2.import_module(mod4)
  
      # Root module and all submodules should be binary serializable since they are cuda module
      assert mod.type_key == "cuda"
      assert mod.is_binary_serializable
      assert mod.imported_modules[0].type_key == "cuda"
      assert mod.imported_modules[0].is_binary_serializable
      assert (
          mod.imported_modules[0].imported_modules[0].type_key == "cuda"
      )
      assert (
          mod.imported_modules[0].imported_modules[1].type_key == "cuda"
      )
      assert (
          mod.imported_modules[0]
          .imported_modules[0]
          .is_binary_serializable
      )
      assert (
          mod.imported_modules[0]
          .imported_modules[1]
          .is_binary_serializable
      )
  
      # The roundtripped mod should have the same structure
      new_mod = tvm.ir.load_json(tvm.ir.save_json(mod))
      assert new_mod.type_key == "cuda"
      assert new_mod.is_binary_serializable
      assert new_mod.imported_modules[0].type_key == "cuda"
      assert new_mod.imported_modules[0].is_binary_serializable
      assert (
          new_mod.imported_modules[0].imported_modules[0].type_key
          == "cuda"
      )
      assert (
          new_mod.imported_modules[0].imported_modules[1].type_key
          == "cuda"
      )
      assert (
          new_mod.imported_modules[0]
          .imported_modules[0]
          .is_binary_serializable
      )
      assert (
          new_mod.imported_modules[0]
          .imported_modules[1]
          .is_binary_serializable
      )
  
file_path: tvm/tests/python/ir/test_roundtrip_runtime_module.py
imports: import pytest
  import tvm
  import tvm.testing
  from tvm import TVMError
  from tvm import relay
label_desc: Use image node_id 6 for calling a global function with example usage: test_valid_submodules() without return types