Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONNX][NMS] init the NMS output tensor with 1s and then slice them away after the loop #7666

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/tvm/relay/frontend/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2629,10 +2629,10 @@ def _outer_body(i, B, C, onnx_out, nms_size_out, out):

# Call the second loop, rework outputs into correct form
init_count = _op.const(np.array([0]).astype("int64"), dtype="int64")
init_out = _op.const(np.array([]).reshape([0, 3]).astype("int64"), dtype="int64")
init_out = _op.const(np.array([1, 1, 1]).reshape([1, 3]).astype("int64"), dtype="int64")
loop_vals = outer_loop(init_count, B, C, onnx_output, nms_size_output, init_out)

return _expr.TupleGetItem(loop_vals, 5)
loop_out = _expr.TupleGetItem(loop_vals, 5)
return _op.strided_slice(loop_out, [1, 0], shape_of(loop_out), [1, 1])


# compatible operators that do NOT require any conversion.
Expand Down