提交 be3eedcc 编写于 作者: D dengkaipeng

fix out_h/out_w calc when out_shape is Variable. test=develop

上级 d02f4c2f
...@@ -7144,14 +7144,16 @@ def image_resize(input, ...@@ -7144,14 +7144,16 @@ def image_resize(input,
it is recommended to use actual_shape instead of \ it is recommended to use actual_shape instead of \
out_shape to specify output shape dynamically.") out_shape to specify output shape dynamically.")
inputs['OutSize'] = out_shape inputs['OutSize'] = out_shape
elif not (_is_list_or_turple_(out_shape)): else:
if not (_is_list_or_turple_(out_shape)):
raise TypeError("out_shape should be a list or tuple or Variable.") raise TypeError("out_shape should be a list or tuple or Variable.")
elif len(out_shape) != 2: if len(out_shape) != 2:
raise ValueError("out_shape length should be 2.") raise ValueError("out_shape length should be 2.")
out_shape = list(map(int, out_shape)) out_shape = list(map(int, out_shape))
attrs['out_h'] = out_shape[0] attrs['out_h'] = out_shape[0]
attrs['out_w'] = out_shape[1] attrs['out_w'] = out_shape[1]
else: else:
if scale <= 0: if scale <= 0:
raise ValueError("scale should be greater than zero.") raise ValueError("scale should be greater than zero.")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册