Skip to content

Commit 348d4e7

Browse files
author
Matthew Brookhart
authored
init the concat tensor with 1s and then slice them away (#7666)
1 parent 7f96986 commit 348d4e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/tvm/relay/frontend/onnx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,10 +2629,10 @@ def _outer_body(i, B, C, onnx_out, nms_size_out, out):
26292629

26302630
# Call the second loop, rework outputs into correct form
26312631
init_count = _op.const(np.array([0]).astype("int64"), dtype="int64")
2632-
init_out = _op.const(np.array([]).reshape([0, 3]).astype("int64"), dtype="int64")
2632+
init_out = _op.const(np.array([1, 1, 1]).reshape([1, 3]).astype("int64"), dtype="int64")
26332633
loop_vals = outer_loop(init_count, B, C, onnx_output, nms_size_output, init_out)
2634-
2635-
return _expr.TupleGetItem(loop_vals, 5)
2634+
loop_out = _expr.TupleGetItem(loop_vals, 5)
2635+
return _op.strided_slice(loop_out, [1, 0], shape_of(loop_out), [1, 1])
26362636

26372637

26382638
# compatible operators that do NOT require any conversion.

0 commit comments

Comments
 (0)