Skip to content

Commit bab3412

Browse files
authored
Remove check in top_k API. (#13178)
1 parent cdd14f1 commit bab3412

File tree

1 file changed

+0
-5
lines changed
  • python/paddle/fluid/layers

1 file changed

+0
-5
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3546,11 +3546,6 @@ def topk(input, k, name=None):
35463546
35473547
top5_values, top5_indices = layers.topk(input, k=5)
35483548
"""
3549-
shape = input.shape
3550-
if k < 1 or k >= shape[-1]:
3551-
raise ValueError("k must be greater than 0 and less than %d." %
3552-
(shape[-1]))
3553-
35543549
helper = LayerHelper("top_k", **locals())
35553550
values = helper.create_tmp_variable(dtype=input.dtype)
35563551
indices = helper.create_tmp_variable(dtype="int64")

0 commit comments

Comments
 (0)