| 284 | self.metadata = metadata |
| 285 | |
| 286 | class MyFunction(tvm_ffi.Function, JitFunction): |
| 287 | def __init__(self, metadata: Any) -> None: |
| 288 | # Explicitly initialize the mixin. `super()` is not used because `tvm_ffi.Function` |
| 289 | # is an extension type without a standard `__init__`. |
| 290 | JitFunction.__init__(self, metadata) |
| 291 | |
| 292 | # When subclassing a Cython cdef class and overriding `__init__`, |
| 293 | # special methods like `__call__` may not be inherited automatically. |
| 294 | # This explicit assignment ensures the subclass remains callable. |
| 295 | __call__ = tvm_ffi.Function.__call__ |
| 296 | |
| 297 | f = tvm_ffi.convert(lambda x: x) |
| 298 | assert isinstance(f, tvm_ffi.Function) |
no outgoing calls