class_docstr: Lowering base class of the Universal Modular Accelerator Interface (UMA).
class_docstr_tok: ["Lowering","base","class","of","the","Universal","Modular","Accelerator","Interface","(","UMA",")","."]
docstr: Lower a Relay primitive function to a S-TIR primitive function.
  
  Parameters
  ----------
  prim_func : tvm.relay.Function
      The Relay function to lower.
  
  Returns
  -------
  out : tvm.tir.PrimFunc
      The lowered schedulable TensorIR primitive function.
docstr_tok: ["Lower","a","Relay","primitive","function","to","a","S-TIR","primitive","function",".","Parameters","--","--","--","--","--","prim_func",":","tvm.relay.Function","The","Relay","function","to","lower",".","Returns","--","--","--","-","out",":","tvm.tir.PrimFunc","The","lowered","schedulable","TensorIR","primitive","function","."]
code: def _lower_relay_to_tir(
      self, relay_prim_func: relay.Function
  ) -> tvm.tir.PrimFunc:
      """Lower a Relay primitive function to a S-TIR primitive function.
  
      Parameters
      ----------
      prim_func : tvm.relay.Function
          The Relay function to lower.
  
      Returns
      -------
      out : tvm.tir.PrimFunc
          The lowered schedulable TensorIR primitive function.
  
      """
  
      def _get_tensors(te_cached_func):
          return list(te_cached_func.inputs) + list(
              te_cached_func.outputs
          )
  
      lower_to_te = tvm._ffi.get_global_func("relay.backend.LowerToTE")
      te_cached_func = lower_to_te(relay_prim_func)
      x = _get_tensors(te_cached_func)
      tir_prim_func = te.create_prim_func(x)
      tir_prim_func = tir_prim_func.with_attr(
          "global_symbol", relay_prim_func.attrs["global_symbol"]
      )
  
      compiler_attr = relay_prim_func.attrs["Compiler"]
      target = tvm.target.Target.current()
      if target.kind.name != compiler_attr:
          target = tvm.target.Target(compiler_attr)
  
      tir_prim_func = tir_prim_func.with_attr("target", target)
      tir_prim_func = tir_prim_func.with_attr(
          "relay_attrs", relay_prim_func.attrs
      )
      return tir_prim_func
  
file_path: tvm/python/tvm/relay/backend/contrib/uma/api/lower.py
imports: from typing import List, Tuple, Callable, Optional
  import tvm
  from tvm import relay, te
  from tvm.relay.op.op import register_strategy
  from .None import _ffi_api
  from .utils import PassPhase
label_desc: Use image node_id 2 for calling the UMALower obj's underlying member method code with example usage: obj._lower_relay_to_tir(relay_prim_func) and returns: tir_prim_func, unknown