MCPcopy Index your code
hub / github.com/apache/tvm / visit_FunctionDef

Method visit_FunctionDef

python/tvm/script/parser/core/parser.py:700–719  ·  view source on GitHub ↗

The general function definition visit method. Parameters ---------- node : doc.FunctionDef The doc FunctionDef node.

(self, node: doc.FunctionDef)

Source from the content-addressed store, hash-verified

698 return _dispatch(self, "tvm_annotation")(self, node)
699
700 def visit_FunctionDef(self, node: doc.FunctionDef) -> None: # pylint: disable=invalid-name
701 """The general function definition visit method.
702
703 Parameters
704 ----------
705 node : doc.FunctionDef
706 The doc FunctionDef node.
707 """
708 token = self.get_dispatch_token(node)
709 func = dispatch.get(token=token, type_name="FunctionDef", default=None)
710 if func is None:
711 self.report_error(
712 node,
713 """The parser does not understand the decorator,
714 or visit_FunctionDef is not implemented for the decorator with token: """
715 + token,
716 )
717 _dispatch(self, "pre_visit_local_function")(self, node)
718 _dispatch_wrapper(func)(self, node)
719 _dispatch(self, "post_visit_local_function")(self, node)
720
721 def visit_tvm_declare_function(self, node: doc.FunctionDef) -> GlobalVar:
722 token = self.get_dispatch_token(node)

Callers

nothing calls this directly

Calls 5

get_dispatch_tokenMethod · 0.95
report_errorMethod · 0.95
_dispatch_wrapperFunction · 0.85
_dispatchFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected