|
|
|
@ -227,9 +227,8 @@ class InterpolateOpCUDAKernel : public framework::OpKernel<T> {
|
|
|
|
|
: static_cast<float>(in_h) / out_h;
|
|
|
|
|
}
|
|
|
|
|
if (out_w > 1) {
|
|
|
|
|
ratio_w = (align_corners && out_w > 1)
|
|
|
|
|
? static_cast<float>(in_w - 1) / (out_w - 1)
|
|
|
|
|
: static_cast<float>(in_w) / out_w;
|
|
|
|
|
ratio_w = (align_corners) ? static_cast<float>(in_w - 1) / (out_w - 1)
|
|
|
|
|
: static_cast<float>(in_w) / out_w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_h == out_h && in_w == out_w) {
|
|
|
|
@ -302,9 +301,8 @@ class InterpolateGradOpCUDAKernel : public framework::OpKernel<T> {
|
|
|
|
|
: static_cast<float>(in_h) / out_h;
|
|
|
|
|
}
|
|
|
|
|
if (out_w > 1) {
|
|
|
|
|
ratio_w = (align_corners && out_w > 1)
|
|
|
|
|
? static_cast<float>(in_w - 1) / (out_w - 1)
|
|
|
|
|
: static_cast<float>(in_w) / out_w;
|
|
|
|
|
ratio_w = (align_corners) ? static_cast<float>(in_w - 1) / (out_w - 1)
|
|
|
|
|
: static_cast<float>(in_w) / out_w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (in_h == out_h && in_w == out_w) {
|
|
|
|
|