Skip to content

Commit bcb64a8

Browse files
authored
Fix upsample bicubic2d batching handling on CPU. (pytorch#52389) (pytorch#52445)
Summary: Pull Request resolved: pytorch#52389 Fixes: pytorch#49159 Test Plan: Imported from OSS Reviewed By: albanD Differential Revision: D26496319 Pulled By: gchanan fbshipit-source-id: d385cd683ef09e0596a9875ce84d03e6e77acc93
1 parent f07991d commit bcb64a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aten/src/ATen/native/UpSampleBicubic2d.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static void upsample_bicubic2d_out_frame(
2626
const scalar_t* in = &idata[output_y * input_width + output_x];
2727
scalar_t* out = &odata[output_y * output_width + output_x];
2828

29-
for (int64_t c = 0; c < channels; ++c) {
29+
for (int64_t c = 0; c < channels * nbatch; ++c) {
3030
out[0] = in[0];
3131
in += input_width * input_height;
3232
out += output_width * output_height;

test/test_nn.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8674,7 +8674,7 @@ def test_upsamplingBicubic2d(self):
86748674
kwargs = dict(mode='bicubic', align_corners=align_corners)
86758675
# test float scale factor up & downsampling
86768676
for device in device_list:
8677-
for scale_factor in [0.5, 1.5, 2]:
8677+
for scale_factor in [0.5, 1, 1.5, 2]:
86788678
in_t = torch.ones(2, 2, 2, 2).to(device)
86798679
out_t = F.interpolate(in_t, scale_factor=scale_factor, **kwargs)
86808680
out_size = int(math.floor(in_t.shape[-1] * scale_factor))

0 commit comments

Comments
 (0)