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

Function test_scan

tests/python/relax/test_tvmscript_parser_op_statistical.py:191–205  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

189
190
191def test_scan():
192 @R.function
193 def foo(x: R.Tensor((2, 3, 4), "float32")):
194 lv = R.cumsum(x, axis=1, dtype="int32")
195 gv = R.cumprod(lv, axis=1, dtype="int32")
196 return gv
197
198 x = relax.Var("x", R.Tensor((2, 3, 4), "float32"))
199 bb = relax.BlockBuilder()
200 with bb.function("foo", [x]):
201 lv = bb.emit(relax.op.cumsum(x, axis=1, dtype="int32"))
202 gv = bb.emit(relax.op.cumprod(lv, axis=1, dtype="int32"))
203 bb.emit_func_output(gv)
204
205 _check(foo, bb.get()["foo"])
206
207
208if __name__ == "__main__":

Callers

nothing calls this directly

Calls 7

functionMethod · 0.95
emitMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
TensorMethod · 0.80
_checkFunction · 0.70
cumsumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…