Skip to content

Commit

Permalink
update the annotation of add new topk, test=develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wawltor committed Aug 24, 2020
1 parent 48b61fa commit 5ef21ed
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions paddle/fluid/operators/top_k_v2_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,11 @@ See the License for the specific language governing permissions and
limitations under the License. */

/*
The reason why we need the topk v2 is that the difference of dealing with NaN
in topk op
between paddle and other DL framework. In the paddle framework, the action is
undefine that compare with
NaN and other values. In other framework, the NaN is bigger.
for example, [1, NaN, 1] is the input of topk,
paddle output is [1, NaN, 1]
other DL framework is [NaN, 1, 1]
so we need the v2 topk.
The reason why we need the topk v2 is because the compatibility. We redefine
the NaN is maximum value
in the process of comparing. If do not add the topk v2, will affect the
inference result of model that traing
by the older version paddlepaddle.
*/

#pragma once
Expand Down

0 comments on commit 5ef21ed

Please sign in to comment.