MCPcopy Index your code
hub / github.com/apache/tvm / test_ones

Function test_ones

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

Source from the content-addressed store, hash-verified

68
69
70def test_ones():
71 @R.function
72 def foo(dumb_param: R.Tensor()) -> R.Tensor((2, 3), "float32"):
73 gv: R.Tensor((2, 3), "float32") = R.ones((2, 3), "float32")
74 return gv
75
76 bb = relax.BlockBuilder()
77 dumb_param = relax.Var("dumb_param", R.Tensor())
78 with bb.function("foo", [dumb_param]):
79 gv = bb.emit(relax.op.ones((2, 3), "float32"))
80 bb.emit_func_output(gv)
81
82 _check(foo, bb.get()["foo"])
83
84
85def test_ones_like():

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…