From bab341213e825f83f19a7af9b9241c44e71993eb Mon Sep 17 00:00:00 2001 From: qingqing01 Date: Wed, 5 Sep 2018 09:40:41 +0800 Subject: [PATCH] Remove check in top_k API. (#13178) --- python/paddle/fluid/layers/nn.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/python/paddle/fluid/layers/nn.py b/python/paddle/fluid/layers/nn.py index a0d92fd1462..d8c7cc08b65 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -3546,11 +3546,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") -- GitLab