A Module that can add global vars during parsing, to support `Module.function` syntax.
| 24 | |
| 25 | |
| 26 | class ModuleWithGlobalVars: |
| 27 | """A Module that can add global vars during parsing, to support `Module.function` syntax.""" |
| 28 | |
| 29 | def __getattr__(self, attr): |
| 30 | # Customize the error message. |
| 31 | # NOTE: `__getattr__` is only called when the attribute access fails with an AttributeError |
| 32 | raise AttributeError(f"Cannot find the function `{attr}` in the current IRModule") |
| 33 | |
| 34 | |
| 35 | @dispatch.register(token="ir", type_name="ClassDef") |
no outgoing calls
no test coverage detected
searching dependent graphs…