Skip to content

Commit

Permalink
Use dynamic topk
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthesun committed Sep 15, 2020
1 parent 2046983 commit f5195bf
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions python/tvm/relay/frontend/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,7 @@ def _impl(inputs, input_types):
def _topk():
def _impl(inputs, input_types):
data = inputs[0]
if isinstance(inputs[0], _expr.Expr):
try:
k = _infer_value(inputs[1], {}).asnumpy().tolist()
k = _expr.const(k)
except Exception:
k = inputs[1]
else:
k = inputs[1]
k = inputs[1]
axis = int(inputs[2])
is_ascend = not bool(inputs[3])
sort = bool(inputs[4])
Expand Down

0 comments on commit f5195bf

Please sign in to comment.