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

Function test_mean

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

Source from the content-addressed store, hash-verified

80
81
82def test_mean():
83 @R.function
84 def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tensor((1, 3), "float32"):
85 gv: R.Tensor((1, 3), "float32") = R.mean(x, axis=[1, 3])
86 return gv
87
88 x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32"))
89 bb = relax.BlockBuilder()
90 with bb.function("foo", [x]):
91 gv = bb.emit(relax.op.mean(x, axis=[1, 3]))
92 bb.emit_func_output(gv)
93
94 _check(foo, bb.get()["foo"])
95
96
97def test_median():

Callers

nothing calls this directly

Calls 7

functionMethod · 0.95
emitMethod · 0.95
emit_func_outputMethod · 0.95
getMethod · 0.95
TensorMethod · 0.80
meanMethod · 0.80
_checkFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…