[Fix] bug of resize warning when align_corners is True (#1592)

Signed-off-by: FreyWang <wangwxyz@qq.com>
pull/1597/head
FreyWang 2022-05-18 16:39:52 +08:00 committed by GitHub
parent 4534fb6868
commit 4f394b0674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ def resize(input,
if size is not None and align_corners:
input_h, input_w = tuple(int(x) for x in input.shape[2:])
output_h, output_w = tuple(int(x) for x in size)
if output_h > input_h or output_w > output_h:
if output_h > input_h or output_w > input_w:
if ((output_h > 1 and output_w > 1 and input_h > 1
and input_w > 1) and (output_h - 1) % (input_h - 1)
and (output_w - 1) % (input_w - 1)):