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

Function test_nested_dataflow

tests/python/relax/test_analysis_well_formed.py:475–496  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

473
474
475def test_nested_dataflow():
476 scalar_struct_info = rx.TensorStructInfo(shape=[], dtype="int32")
477 gv0 = rx.Var("gv0", scalar_struct_info)
478 f = rx.DataflowVar("f", rx.FuncStructInfo([], scalar_struct_info))
479 x0 = rx.DataflowVar("x0", scalar_struct_info)
480 x1 = rx.DataflowVar("x1", scalar_struct_info)
481 x2 = rx.DataflowVar("x2", scalar_struct_info)
482 y = rx.Var("y", scalar_struct_info)
483 inner_block = rx.DataflowBlock([rx.VarBinding(x0, rx.const(2, "int32")), rx.VarBinding(y, x0)])
484 inner_func = rx.Function([], rx.SeqExpr([inner_block], y), scalar_struct_info)
485 outer_block = rx.DataflowBlock(
486 [
487 rx.VarBinding(x1, rx.const(1, "int32")),
488 rx.VarBinding(f, inner_func),
489 rx.VarBinding(x2, rx.op.add(x1, rx.Call(f, []))),
490 rx.VarBinding(gv0, x2),
491 ]
492 )
493 func = rx.Function([], rx.SeqExpr([outer_block], gv0), scalar_struct_info)
494 mod = tvm.IRModule.from_expr(func)
495 normalized = rx.transform.Normalize()(mod)
496 rx.analysis.well_formed(normalized)
497
498
499def test_sinfo_args_tir_var_used_before_define_call_packed():

Callers

nothing calls this directly

Calls 3

FunctionMethod · 0.80
from_exprMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…