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

Method get_macro_def

python/tvm/script/parser/core/parser.py:135–140  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133 raise RuntimeError(f"{ScriptMacro.parser_object_name} not available")
134
135 def get_macro_def(self):
136 ast_module = self.source.as_ast()
137 for decl in ast_module.body:
138 if isinstance(decl, doc.FunctionDef) and decl.name == self.func.__name__:
139 return decl
140 raise RuntimeError(f"cannot find macro definition for {self.func.__name__}")
141
142 def __call__(self, *args, **kwargs):
143 param_binding = inspect.signature(self.func).bind(*args, **kwargs)

Callers 3

parse_macroMethod · 0.80
parse_macroMethod · 0.80
parse_macroMethod · 0.80

Calls 1

as_astMethod · 0.80

Tested by

no test coverage detected