Skip to content

Commit

Permalink
fix slicing before topk
Browse files Browse the repository at this point in the history
  • Loading branch information
masahi committed Jun 2, 2021
1 parent e66923f commit 0bba350
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/tvm/relay/frontend/tensorflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,10 +842,9 @@ def true_branch():
def false_branch():
if isinstance(max_output_boxes_per_class, int):
# Do topk on smaller input if possible
# TODO(masahi): use axes argument in strided slice when it becomes available
slice_mx = _op.const([-1, max_output_boxes_per_class * num_class], dtype="int64")
slice_mx = _op.const([max_output_boxes_per_class * num_class], dtype="int64")
selected_scores_slice = _op.strided_slice(
selected_scores, begin=_op.const([0, 0], dtype="int64"), end=slice_mx
selected_scores, begin=_op.const([0], dtype="int64"), end=slice_mx, axes=[1]
)
else:
selected_scores_slice = selected_scores
Expand Down

0 comments on commit 0bba350

Please sign in to comment.