| 206 | |
| 207 | |
| 208 | def test_func(): |
| 209 | x = rx.Var("foo", R.Tensor("float32", ndim=2)) |
| 210 | bindings = [rx.VarBinding(x, rx.const(1))] |
| 211 | blocks = [rx.BindingBlock(bindings)] |
| 212 | seqe = rx.SeqExpr(blocks, x) |
| 213 | func = rx.Function([x], seqe, R.Tensor("float32")) |
| 214 | func = func.with_attr("global_symbol", "func") |
| 215 | |
| 216 | func_str = dump_ast(func) |
| 217 | assert func_str.startswith("Function(") |
| 218 | assert "params=" in func_str |
| 219 | assert "body=" in func_str |
| 220 | assert "ret_struct_info=" in func_str |
| 221 | assert "is_pure=" in func_str |
| 222 | assert "attrs=" in func_str |
| 223 | assert '"global_symbol": "func"' in func_str |
| 224 | assert "SeqExpr(" in func_str |
| 225 | assert "blocks=" in func_str |
| 226 | assert "VarBinding(" in func_str |
| 227 | |
| 228 | |
| 229 | def test_shape_of(): |