code: def relay_to_runtime(
      target: tvm.target.Target,
  ) -> Callable[[relay.Function], tvm.runtime.Module]:
      """Create a Relay to runtime module lowering function using Tensor Expressions for lowering."""
  
      def _relay_to_runtime(
          partition: relay.Function,
      ) -> tvm.runtime.Module:
          """Compile Relay functions to a runtime module using Tensor Expressions."""
          assert isinstance(partition, relay.Function)
          assert isinstance(partition.body, relay.Call)
          assert isinstance(partition.body.op, relay.Function)
  
          global_name = str(partition.attrs.global_symbol)
          comp_func = partition.body.op
          comp_name = comp_func.attrs["Composite"]
          assert comp_name in _LOWER_MAP
          assert isinstance(comp_func.body, relay.Call)
  
          op = comp_func.body
          inputs = []
          for i, param in enumerate(comp_func.params):
              inputs.append(
                  te.placeholder(
                      param.checked_type.shape,
                      name=f"input_{i}",
                      dtype=param.checked_type.dtype,
                  )
              )
  
          output = _LOWER_MAP[comp_name](op, inputs)
          prim_func = te.create_prim_func(inputs + [output])
          return tvm.build(prim_func, target=target, name=global_name)
  
      return _relay_to_runtime
  
imports: from typing import Callable, List, Dict
  import tvm
  import tvm.ir
  from tvm import relay
  from tvm import te
label_desc: Use image node_id 2 for calling a global function with example usage: relay_to_runtime(target) and returns: _relay_to_runtime, tvm