Skip to content

Commit

Permalink
fix functor
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzSean committed Jan 17, 2022
1 parent 5d9c1aa commit 418445b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddle/fluid/operators/softmax_cudnn_op.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ struct SoftmaxBackwardFunctor {
HOSTDEVICE inline SoftmaxBackwardFunctor(Tx sum) : sum(sum) {}

HOSTDEVICE inline Ty operator()(const Tx& grad_out, const Tx& out) const {
return static_cast<Ty>(grad_out - out * sum);
return static_cast<Ty>(out * (grad_out - sum));
}

private:
Expand Down

0 comments on commit 418445b

Please sign in to comment.