Skip to content

Commit f3db005

Browse files
committed
fix errors
1 parent e1599eb commit f3db005

File tree

1 file changed

+6
-4
lines changed
  • python/paddle/fluid/layers

1 file changed

+6
-4
lines changed

python/paddle/fluid/layers/nn.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
'label_smooth',
8282
'roi_pool',
8383
'dice_loss',
84+
'image_resize',
85+
'image_resize_short',
8486
'resize_bilinear',
8587
'gather',
8688
'random_crop',
@@ -4036,7 +4038,7 @@ def image_resize_short(input, out_short_len, resample='BILINEAR'):
40364038
This is a 4-D tensor of the shape
40374039
(num_batches, channels, in_h, in_w).
40384040
out_short_len(int): The length of output images' short edge.
4039-
4041+
40404042
Returns:
40414043
out (Variable): The output is a 4-D tensor of the shape
40424044
(num_batches, channls, out_h, out_w).
@@ -4050,9 +4052,9 @@ def image_resize_short(input, out_short_len, resample='BILINEAR'):
40504052
long_idx = 1 - short_idx
40514053
out_shape = list(hw)
40524054
out_shape[short_idx] = out_short_len
4053-
out_shape[long_idx] = round(
4054-
float(out_shape[long_idx]) *
4055-
(float(out_short_len) / float(hw[short_idx])))
4055+
out_shape[long_idx] = int(
4056+
float(out_shape[long_idx]) * (float(out_short_len) / float(hw[
4057+
short_idx])) + 0.5)
40564058
return image_resize(input=input, out_shape=out_shape, resample=resample)
40574059

40584060

0 commit comments

Comments
 (0)