Skip to content

Commit a5c47c5

Browse files
committed
PR comment
1 parent 75b4490 commit a5c47c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/phi/kernels/funcs/dropout_impl.cu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void DropoutFwGPUKernelDriver(
311311
auto* mask_data = mask->data<uint8_t>();
312312
size_t size = phi::product(mask->dims());
313313

314-
if (abs(dropout_prob / 1.0f - 1) < 5.96e-08) {
314+
if (dropout_prob == 1.0f) {
315315
#ifdef PADDLE_WITH_HIP
316316
PADDLE_ENFORCE_GPU_SUCCESS(
317317
hipMemsetAsync(y_data, 0, x_numel * sizeof(T), stream));
@@ -459,7 +459,7 @@ void DropoutGradGPUKernelDriver(const phi::GPUContext& dev_ctx,
459459
// y = factor * x
460460
ScaleByDropoutFactor<T, MT>(dev_ctx, grad_y, grad_x, factor);
461461
} else {
462-
if (upscale_in_train && abs(dropout_prob / 1.0f - 1) < 5.96e-08) {
462+
if (upscale_in_train && dropout_prob == 1.0f) {
463463
#ifdef PADDLE_WITH_HIP
464464
hipMemset(grad_x->data<T>(), 0, grad_x->numel() * sizeof(T));
465465
#else

0 commit comments

Comments
 (0)