MCPcopy Create free account
hub / github.com/apache/tvm-ffi / _ffi_init

Function _ffi_init

tests/python/test_dataclass_init.py:56–61  ·  view source on GitHub ↗

Look up __ffi_init__ from the TypeAttrColumn and call it via __init_handle_by_constructor__.

(obj: Any, *args: Any)

Source from the content-addressed store, hash-verified

54
55
56def _ffi_init(obj: Any, *args: Any) -> None:
57 """Look up __ffi_init__ from the TypeAttrColumn and call it via __init_handle_by_constructor__."""
58 type_index = type(obj).__tvm_ffi_type_info__.type_index
59 ffi_init = core._lookup_type_attr(type_index, "__ffi_init__")
60 assert ffi_init is not None, f"No __ffi_init__ TypeAttrColumn entry for {type(obj)}"
61 obj.__init_handle_by_constructor__(ffi_init, *args)
62
63
64def _field_map(type_cls: type) -> dict[str, Any]:

Calls

no outgoing calls

Tested by

no test coverage detected