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

Function test_variance

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

Source from the content-addressed store, hash-verified

114
115
116def test_variance():
117 @R.function
118 def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tensor((1,), "float32"):
119 gv: R.Tensor((1,), "float32") = R.variance(x, axis=[-1, -2, -3])
120 return gv
121
122 x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32"))
123 bb = relax.BlockBuilder()
124 with bb.function("foo", [x]):
125 gv = bb.emit(relax.op.variance(x, axis=[-1, -2, -3]))
126 bb.emit_func_output(gv)
127
128 _check(foo, bb.get()["foo"])
129
130
131def test_max():

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…