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

Method _get_function_source

python/tvm/relax/base_py_module.py:578–585  ·  view source on GitHub ↗

Get the source code of a Python function.

(self, func: callable)

Source from the content-addressed store, hash-verified

576 return "\n".join(result_lines)
577
578 def _get_function_source(self, func: callable) -> str | None:
579 """Get the source code of a Python function."""
580 try:
581 source = inspect.getsource(func)
582 return source
583 except (OSError, TypeError):
584 # If we can't get the source, return None
585 return None
586
587 def _format_python_function(self, _func_name: str, func_source: str, indent: int) -> str:
588 """Format a Python function with proper indentation for TVMScript."""

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected