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

Function test_sum_keep_dims

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

Source from the content-addressed store, hash-verified

65
66
67def test_sum_keep_dims():
68 @R.function
69 def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tensor((1, 1, 3, 1), "float32"):
70 gv: R.Tensor((1, 1, 3, 1), "float32") = R.sum(x, axis=[1, 3], keepdims=True)
71 return gv
72
73 x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32"))
74 bb = relax.BlockBuilder()
75 with bb.function("foo", [x]):
76 gv = bb.emit(relax.op.sum(x, axis=[1, 3], keepdims=True))
77 bb.emit_func_output(gv)
78
79 _check(foo, bb.get()["foo"])
80
81
82def test_mean():

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
sumMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…