topk中当输入k为tensor时,结果有误
Created by: mamingjie-China
PaddlePaddle 1.8.1,python3.7 topk中,当输入的k为tensor时,无论tensor的值是多少,结果都是相同 示例代码: import paddle.fluid as fluid import paddle.fluid.layers as layers input2 = layers.data(name="input2", shape=[13, 11], dtype='float32') vk = fluid.layers.fill_constant(shape=[1], value=6, dtype='int64') vk_values, vk_indices = layers.topk(input2, k=vk) print(vk_values, vk_indices)