|
|
|
@ -227,8 +227,7 @@ 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)
|
|
|
|
|
ratio_w = (align_corners) ? static_cast<float>(in_w - 1) / (out_w - 1)
|
|
|
|
|
: static_cast<float>(in_w) / out_w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -302,8 +301,7 @@ 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)
|
|
|
|
|
ratio_w = (align_corners) ? static_cast<float>(in_w - 1) / (out_w - 1)
|
|
|
|
|
: static_cast<float>(in_w) / out_w;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|