MCPcopy Create free account
hub / github.com/apache/tvm / test_func

Function test_func

tests/python/relax/test_ast_printer.py:208–226  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206
207
208def 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
229def test_shape_of():

Callers

nothing calls this directly

Calls 4

dump_astFunction · 0.90
TensorMethod · 0.80
FunctionMethod · 0.80
with_attrMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…