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

Function test_emit_with_name

tests/python/relax/test_blockbuilder_core.py:68–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67
68def test_emit_with_name():
69 m = tirx.Var("m", "int64")
70 n = tirx.Var("n", "int64")
71 x = rx.Var("x", rx.TensorStructInfo([m, n], "float16"))
72 y = rx.Var("y", rx.TensorStructInfo([n], "float16"))
73 bb = rx.BlockBuilder()
74
75 bb._begin_dataflow_block()
76 lv0 = bb.emit(rx.op.add(x, y), "add")
77 gv0 = bb.emit_output(rx.op.multiply(lv0, y), "multi")
78 b0 = bb._end_block()
79
80 assert b0.bindings[0].var.name_hint == "add"
81 assert b0.bindings[1].var.name_hint == "multi"
82
83
84def test_function_single_block():

Callers

nothing calls this directly

Calls 6

_begin_dataflow_blockMethod · 0.95
emitMethod · 0.95
emit_outputMethod · 0.95
_end_blockMethod · 0.95
addMethod · 0.45
multiplyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…