8000
We read every piece of feedback, and take your input very seriously.
1 parent 2d000fd commit 48abf71Copy full SHA for 48abf71
torch/_decomp/decompositions.py
@@ -2780,19 +2780,15 @@ def upsample_bilinear2d(
2780
if align_corners:
2781
h_scale_factor = (in_h - 1) / (out_h - 1)
2782
else:
2783
- h_scale_factor = (
2784
- in_h / (in_h * scales_h) if scales_h is not None else in_h / out_h
2785
- )
+ h_scale_factor = 1.0 / scales_h if scales_h is not None else in_h / out_h
2786
2787
h_scale_factor = 0.0
2788
2789
if out_w > 1:
2790
2791
w_scale_factor = (in_w - 1) / (out_w - 1)
2792
2793
- w_scale_factor = (
2794
- in_w / (in_w * scales_w) if scales_w is not None else in_w / out_w
2795
+ w_scale_factor = 1.0 / scales_w if scales_w is not None else in_w / out_w
2796
2797
w_scale_factor = 0.0
2798