A Module in a Disco session.
| 91 | |
| 92 | |
| 93 | class DModule(DRef): |
| 94 | """A Module in a Disco session.""" |
| 95 | |
| 96 | # tvm_ffi Object subclasses cannot store Python attributes by default |
| 97 | # (the metaclass sets `__slots__ = ()`); list the field(s) we store here. |
| 98 | __slots__ = ("session",) |
| 99 | |
| 100 | def __init__(self, dref: DRef, session: "Session") -> None: |
| 101 | self.__move_handle_from__(dref) |
| 102 | self.session = session |
| 103 | |
| 104 | def __getitem__(self, name: str) -> DPackedFunc: |
| 105 | func = self.session._get_cached_method("ffi.ModuleGetFunction") |
| 106 | return DPackedFunc(func(self, name, False), self.session) |
| 107 | |
| 108 | |
| 109 | @register_object("runtime.disco.Session") |
no outgoing calls
no test coverage detected
searching dependent graphs…