code: def _check_gm_validity(gm: torch.fx.GraphModule):
      for node in gm.graph.nodes:
          assert node.meta[
              "info"
          ].outputs, (
              f"In {gm.__class__.__name__}, {node} has no output shape."
          )
          if node.op in [
              "call_module",  # can apply to params
              "call_function",  # can apply to params
              "call_method",  # can apply to params
          ]:
              assert hasattr(
                  node.meta["info"], "inputs"
              ), f"In {gm.__class__.__name__}, {node} has no input shape."
  
file_path: colossalai/tests/test_analyzer/test_fx/test_shape_prop.py
imports: import pytest
  import torch
  from packaging import version
  from colossalai.testing.utils import clear_cache_before_run, parameterize
  from tests.test_analyzer.test_fx.zoo import tm_models, tmm_models
label_desc: Use image node_id 1 for calling a global function with example usage: _check_gm_validity(gm) without return types