MCPcopy Index your code
hub / github.com/apache/tvm / test_emit_te

Function test_emit_te

tests/python/relax/test_tvmscript_parser.py:255–271  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

253
254
255def test_emit_te():
256 @I.ir_module(s_tir=True)
257 class EmitTE:
258 @R.function
259 def main(x: R.Tensor((10, 20), "float32")) -> R.Tensor((10, 20), dtype="float32"):
260 lv1 = R.emit_te(topi.add, x, x)
261 out = R.emit_te(topi.multiply, lv1, lv1)
262 return out
263
264 bb = relax.BlockBuilder()
265 x = relax.Var("x", relax.TensorStructInfo([10, 20], "float32"))
266 with bb.function("main", [x], {"global_symbol": "main"}):
267 lv1 = bb.emit_te(topi.add, x, x)
268 out = bb.emit_te(topi.multiply, lv1, lv1)
269 bb.emit_func_output(out)
270
271 _check(EmitTE, bb.get())
272
273
274def test_module_with_attr_and_global_info():

Callers

nothing calls this directly

Calls 5

functionMethod · 0.95
emit_teMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
_checkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…