From 909f864a9bff2812bfea39c230ec779bccd54ca5 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Mon, 28 Jan 2019 22:45:11 -0800 Subject: [PATCH] remove unnecessary flags test=develop --- paddle/fluid/operators/interpolate_op.cu | 10 ++++------ paddle/fluid/operators/interpolate_op.h | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/paddle/fluid/operators/interpolate_op.cu b/paddle/fluid/operators/interpolate_op.cu index f86d2c4ab4e..b887878ea22 100644 --- a/paddle/fluid/operators/interpolate_op.cu +++ b/paddle/fluid/operators/interpolate_op.cu @@ -227,9 +227,8 @@ class InterpolateOpCUDAKernel : public framework::OpKernel { : static_cast(in_h) / out_h; } if (out_w > 1) { - ratio_w = (align_corners && out_w > 1) - ? static_cast(in_w - 1) / (out_w - 1) - : static_cast(in_w) / out_w; + ratio_w = (align_corners) ? static_cast(in_w - 1) / (out_w - 1) + : static_cast(in_w) / out_w; } if (in_h == out_h && in_w == out_w) { @@ -302,9 +301,8 @@ class InterpolateGradOpCUDAKernel : public framework::OpKernel { : static_cast(in_h) / out_h; } if (out_w > 1) { - ratio_w = (align_corners && out_w > 1) - ? static_cast(in_w - 1) / (out_w - 1) - : static_cast(in_w) / out_w; + ratio_w = (align_corners) ? static_cast(in_w - 1) / (out_w - 1) + : static_cast(in_w) / out_w; } if (in_h == out_h && in_w == out_w) { diff --git a/paddle/fluid/operators/interpolate_op.h b/paddle/fluid/operators/interpolate_op.h index acdebf73e0d..c631ad1dd15 100644 --- a/paddle/fluid/operators/interpolate_op.h +++ b/paddle/fluid/operators/interpolate_op.h @@ -199,9 +199,8 @@ class InterpolateKernel : public framework::OpKernel { : static_cast(in_h) / out_h; } if (out_w > 1) { - ratio_w = (align_corners && out_w > 1) - ? static_cast(in_w - 1) / (out_w - 1) - : static_cast(in_w) / out_w; + ratio_w = (align_corners) ? static_cast(in_w - 1) / (out_w - 1) + : static_cast(in_w) / out_w; } if ("bilinear" == interp_method) { @@ -258,9 +257,8 @@ class InterpolateGradKernel : public framework::OpKernel { : static_cast(in_h) / out_h; } if (out_w > 1) { - ratio_w = (align_corners && out_w > 1) - ? static_cast(in_w - 1) / (out_w - 1) - : static_cast(in_w) / out_w; + ratio_w = (align_corners) ? static_cast(in_w - 1) / (out_w - 1) + : static_cast(in_w) / out_w; } if ("bilinear" == interp_method) { -- GitLab