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

Class MyFunction

tests/python/test_function.py:286–295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)

Callers 1

test_function_subclassFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_function_subclassFunction · 0.68