Normalize the expr to fill in the struct_info fields everywhere
(func: rx.Function)
| 41 | |
| 42 | |
| 43 | def normalize(func: rx.Function) -> rx.Function: |
| 44 | """ |
| 45 | Normalize the expr to fill in the struct_info fields everywhere |
| 46 | """ |
| 47 | |
| 48 | # using a default mutator to use the BlockBuilder's normalizer, |
| 49 | # which oddly differs from the Normalize pass |
| 50 | @rx.expr_functor.mutator |
| 51 | class DefaultMutator(rx.PyExprMutator): |
| 52 | pass |
| 53 | |
| 54 | mod = tvm.IRModule() |
| 55 | mod["main"] = func |
| 56 | mut = DefaultMutator(mod) |
| 57 | mod["main"] = mut.visit_expr(func) |
| 58 | return mod["main"] |
| 59 | |
| 60 | |
| 61 | def assert_fields(nodename: str, fields: dict[str, str], target: str) -> None: |
no test coverage detected
searching dependent graphs…