Skip to content

Commit

Permalink
Merge pull request #13228 from qingqing01/top_k_api
Browse files Browse the repository at this point in the history
Remoe check in top_k API
  • Loading branch information
panyx0718 authored Sep 5, 2018
2 parents ed11f49 + a5f0376 commit 1ca241c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions python/paddle/fluid/layers/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3542,11 +3542,6 @@ def topk(input, k, name=None):
top5_values, top5_indices = layers.topk(input, k=5)
"""
shape = input.shape
if k < 1 or k >= shape[-1]:
raise ValueError("k must be greater than 0 and less than %d." %
(shape[-1]))

helper = LayerHelper("top_k", **locals())
values = helper.create_tmp_variable(dtype=input.dtype)
indices = helper.create_tmp_variable(dtype="int64")
Expand Down

0 comments on commit 1ca241c

Please sign in to comment.