Get documentation string for a function exported from the module. This retrieves documentation for functions exported via c:macro:`TVM_FFI_DLL_EXPORT_TYPED_FUNC_DOC`. Parameters ---------- name The name of the function query_imports
(self, name: str, query_imports: bool = False)
| 239 | return json.loads(metadata_str) |
| 240 | |
| 241 | def get_function_doc(self, name: str, query_imports: bool = False) -> str | None: |
| 242 | """Get documentation string for a function exported from the module. |
| 243 | |
| 244 | This retrieves documentation for functions exported via c:macro:`TVM_FFI_DLL_EXPORT_TYPED_FUNC_DOC`. |
| 245 | |
| 246 | Parameters |
| 247 | ---------- |
| 248 | name |
| 249 | The name of the function |
| 250 | |
| 251 | query_imports |
| 252 | Whether to also query modules imported by this module. |
| 253 | |
| 254 | Returns |
| 255 | ------- |
| 256 | doc : str or None |
| 257 | The documentation string if available, None otherwise. |
| 258 | |
| 259 | Examples |
| 260 | -------- |
| 261 | .. code-block:: python |
| 262 | |
| 263 | import tvm_ffi |
| 264 | |
| 265 | mod = tvm_ffi.load_module("mylib.so") |
| 266 | doc = mod.get_function_doc("process_batch") |
| 267 | if doc: |
| 268 | print(doc) |
| 269 | |
| 270 | See Also |
| 271 | -------- |
| 272 | :py:meth:`get_function_metadata` |
| 273 | Get metadata including type schema. |
| 274 | |
| 275 | """ |
| 276 | doc_str = _ffi_api.ModuleGetFunctionDoc(self, name, query_imports) |
| 277 | return doc_str if doc_str else None |
| 278 | |
| 279 | def import_module(self, module: Module) -> None: |
| 280 | """Add module to the import list of current one. |
no outgoing calls