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

Function test_median

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

Source from the content-addressed store, hash-verified

95
96
97def test_median():
98 @R.function
99 def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tuple(
100 R.Tensor((1, 3, 4), "float32"), R.Tensor((1, 3, 4), "int64")
101 ):
102 gv: R.Tuple(R.Tensor((1, 3, 4), "float32"), R.Tensor((1, 3, 4), "int64")) = R.median(
103 x, axis=[1]
104 )
105 return gv
106
107 x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32"))
108 bb = relax.BlockBuilder()
109 with bb.function("foo", [x]):
110 gv = bb.emit(relax.op.median(x, axis=[1]))
111 bb.emit_func_output(gv)
112
113 _check(foo, bb.get()["foo"])
114
115
116def test_variance():

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…