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

Function test_argmax

tests/python/relax/test_tvmscript_parser_op_search.py:58–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def test_argmax():
59 @R.function
60 def foo(x: R.Tensor((1, 2, 3, 4), "float32")) -> R.Tensor((1, 3, 4), "int64"):
61 gv: R.Tensor((1, 3, 4), "int64") = R.argmax(x, axis=1)
62 return gv
63
64 x = relax.Var("x", R.Tensor((1, 2, 3, 4), "float32"))
65 bb = relax.BlockBuilder()
66 with bb.function("foo", [x]):
67 gv = bb.emit(relax.op.argmax(x, axis=1))
68 bb.emit_func_output(gv)
69
70 _check(foo, bb.get()["foo"])
71
72
73def test_argmax_without_specified_axis():

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…