From 1829c3a55c4f0e2851b64b8e2ec3d3a6e7683aac 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 c5c92619e..93a0b5680 100644 --- a/python/paddle/fluid/layers/nn.py +++ b/python/paddle/fluid/layers/nn.py @@ -3496,11 +3496,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