Construct a module from a standalone expression. Parameters ---------- expr: RelaxExpr The starting expression global_funcs: Optional[dict] Map of global vars to function definitions Returns ------- mod: Module
(expr, functions=None)
| 197 | |
| 198 | @staticmethod |
| 199 | def from_expr(expr, functions=None): |
| 200 | """Construct a module from a standalone expression. |
| 201 | |
| 202 | Parameters |
| 203 | ---------- |
| 204 | expr: RelaxExpr |
| 205 | The starting expression |
| 206 | |
| 207 | global_funcs: Optional[dict] |
| 208 | Map of global vars to function definitions |
| 209 | |
| 210 | Returns |
| 211 | ------- |
| 212 | mod: Module |
| 213 | A module containing the passed definitions, |
| 214 | where expr is set as the entry point |
| 215 | (wrapped in a function if necessary) |
| 216 | """ |
| 217 | funcs = functions if functions is not None else {} |
| 218 | return _ffi_api.Module_FromExpr(expr, funcs) |
| 219 | |
| 220 | def get_attr(self, attr_key): |
| 221 | """Get the IRModule attribute. |
no outgoing calls