code: def test_lower_compiler():
      @tvm._ffi.register_func("relay.ext.test_pass_lower_te")
      def relay_ext_test_pass_lower_te(func):
          return None
  
      input_mod = tvm.relay.parse(
          """
          #[version = "0.0.5"]
          def @main(%a: Tensor[(5, 7), float32]) -> Tensor[(5, 7), float32] {
            %0 = fn(%x : Tensor[(5, 7), float32], %y : Tensor[(5, 7), float32], Primitive=1, Compiler="test_pass_lower_te", global_symbol="test_add") -> Tensor[(5, 7), float32] {
              add(%x, %y)
            };
            %0(%a, %a)
          }
          """,
          "from_string",
          None,
          None,
      )
  
      actual_mod = transform(input_mod)
  
      # Expected:
      #   def @main(%a : Tensor[(5, 7), float32]) -> Tensor[(5, 7), float32] {
      #     %0 = (%a, %a)
      #     call_lowered(@test_add , %0, metadata={relay_attrs={Primitive=1, Compiler="test_pass_lower_te", global_symbol="test_add"}}, all_prim_fn_vars=[]})
      #   }
      #   def @test_add(%x: Tensor[(5, 7), float32], %y: Tensor[(5, 7), float32], Extern=1) -> Tensor[(5, 7), float32] {
      #     add(%x, %y)
      #   }
  
      main = actual_mod["main"]
      call = main.body
      assert call.op.name == "call_lowered"
      assert len(call.args) == 2
      assert call.args[0].name_hint == "test_add"
      assert len(call.args[1].fields) == 2
      assert call.args[1].fields[0].name_hint == "a"
      assert call.args[1].fields[1].name_hint == "a"
      assert call.attrs.metadata["relay_attrs"].Primitive == 1
      assert (
          call.attrs.metadata["relay_attrs"].Compiler
          == "test_pass_lower_te"
      )
      assert (
          call.attrs.metadata["relay_attrs"].global_symbol == "test_add"
      )
      assert len(call.attrs.metadata["all_prim_fn_vars"]) == 0
  
      test_add = actual_mod["test_add"]
      assert isinstance(test_add, tvm.relay.Function)
      assert test_add.attrs["Extern"] == 1
  
file_path: tvm/tests/python/relay/backend/test_pass_lower_te.py
imports: import tvm
  import tvm.testing
  import logging
label_desc: Use image node_id 3 for calling a global function with example usage: test_lower_compiler() and returns: None