Skip to content

Commit a44e9f1

Browse files
fix clip_grad bug (#71895)
* fix clip_grad bug
1 parent b5778f8 commit a44e9f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

paddle/phi/kernels/impl/clip_grad_kernel_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ClipGradFunctor {
2929
public:
3030
explicit ClipGradFunctor(const T min, const T max) : min_(min), max_(max) {}
3131
HOSTDEVICE T operator()(const T x, const T y) const {
32-
return (y > min_ && y < max_) ? x : static_cast<T>(0);
32+
return (y >= min_ && y <= max_) ? x : static_cast<T>(0);
3333
}
3434

3535
private:

0 commit comments

Comments
 (0)