From c984b0fc8808a531facc4032a6c84b75c2109707 Mon Sep 17 00:00:00 2001 From: nhussain Date: Thu, 16 Jul 2020 13:26:24 -0400 Subject: [PATCH] fix size tuple --- .../dataset/transforms/vision/c_transforms.py | 2 - .../data/dataset/golden/resize_01_result.npz | Bin 0 -> 644 bytes .../data/dataset/golden/resize_02_result.npz | Bin 0 -> 644 bytes tests/ut/python/dataset/test_resize.py | 117 ++++++++++++++++++ 4 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 tests/ut/data/dataset/golden/resize_01_result.npz create mode 100644 tests/ut/data/dataset/golden/resize_02_result.npz create mode 100644 tests/ut/python/dataset/test_resize.py diff --git a/mindspore/dataset/transforms/vision/c_transforms.py b/mindspore/dataset/transforms/vision/c_transforms.py index 2de575d14..b4245cc21 100644 --- a/mindspore/dataset/transforms/vision/c_transforms.py +++ b/mindspore/dataset/transforms/vision/c_transforms.py @@ -319,8 +319,6 @@ class Resize(cde.ResizeOp): @check_resize_interpolation def __init__(self, size, interpolation=Inter.LINEAR): - if isinstance(size, int): - size = (size, size) self.size = size self.interpolation = interpolation interpoltn = DE_C_INTER_MODE[interpolation] diff --git a/tests/ut/data/dataset/golden/resize_01_result.npz b/tests/ut/data/dataset/golden/resize_01_result.npz new file mode 100644 index 0000000000000000000000000000000000000000..b3a52243a4d660ff8dfde41256c43e0c479a7e56 GIT binary patch literal 644 zcmWIWW@Zs#fB;2?J%>!y{xC8yfG{V62t#5~QM`d(UO^=zg8*0%q!1(t0+anheFGvH z8Oj){)l*W7lZ(`?6x3_{)pZoq)AEZ-iW2kU^NUhaLBei{ImM|!@#2icf>a=1!%#=T zNK;3lR)KuL)xeybSDIT;sh6Bzl&Y6onp2VqbZ=rMSA0=wa(-TMNl|HX30ENlL={(F z3PiS$(VL;Qkja@bsgSw7kR_;)Rl}PR2$|Xn*`P{ON-7IdxeD1Mn1J5&w!y{xC8yfG{V62t#5~QM`d(UO^=zg8*0%q!1(t0+anheFGvH z8Oj){)l*W7lZ(`?6x3_{)pZoq)AEZ-iW2kU^NUhaLBei{ImM|!@#2icf>a=1!%#=T zNK;3lR)KuL)xeybSDIT;sh6Bzl&Y6onp2VqbZ=rMSA0=wa(-TMNl|HX30ENlL={(F z3PiS$(VL;Qkja@bsgSw7kR_;)Rl}PR2$|Xn*`P{ON-7IdxeD1Mn1J5&w