Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
510f095d
"src/vscode:/vscode.git/clone" did not exist on "723dbdd36300cd5a14000b828aaef87ba7e1fa68"
Commit
510f095d
authored
Mar 23, 2017
by
Bodo Kaiser
Committed by
Soumith Chintala
Mar 23, 2017
Browse files
fixed linter complaints
parent
6d2423c7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
test/test_transforms.py
test/test_transforms.py
+0
-6
No files found.
test/test_transforms.py
View file @
510f095d
...
@@ -158,22 +158,16 @@ class Tester(unittest.TestCase):
...
@@ -158,22 +158,16 @@ class Tester(unittest.TestCase):
img_data_byte
=
torch
.
ByteTensor
(
1
,
4
,
4
).
random_
(
0
,
255
)
img_data_byte
=
torch
.
ByteTensor
(
1
,
4
,
4
).
random_
(
0
,
255
)
img_data_short
=
torch
.
ShortTensor
(
1
,
4
,
4
).
random_
()
img_data_short
=
torch
.
ShortTensor
(
1
,
4
,
4
).
random_
()
img_data_int
=
torch
.
IntTensor
(
1
,
4
,
4
).
random_
()
img_data_int
=
torch
.
IntTensor
(
1
,
4
,
4
).
random_
()
img_data_float
=
torch
.
FloatTensor
(
1
,
4
,
4
).
uniform_
()
img_byte
=
trans
(
img_data_byte
)
img_byte
=
trans
(
img_data_byte
)
img_short
=
trans
(
img_data_short
)
img_short
=
trans
(
img_data_short
)
img_int
=
trans
(
img_data_int
)
img_int
=
trans
(
img_data_int
)
img_float
=
trans
(
img_data_float
)
assert
img_byte
.
mode
==
'L'
assert
img_byte
.
mode
==
'L'
assert
img_short
.
mode
==
'I;16'
assert
img_short
.
mode
==
'I;16'
assert
img_int
.
mode
==
'I'
assert
img_int
.
mode
==
'I'
#assert img_float.mode == 'F'
assert
np
.
allclose
(
img_data_short
.
numpy
(),
to_tensor
(
img_short
).
numpy
())
assert
np
.
allclose
(
img_data_short
.
numpy
(),
to_tensor
(
img_short
).
numpy
())
assert
np
.
allclose
(
img_data_int
.
numpy
(),
to_tensor
(
img_int
).
numpy
())
assert
np
.
allclose
(
img_data_int
.
numpy
(),
to_tensor
(
img_int
).
numpy
())
# would cause breaking changes as ToTensor converts to range [0, 1]
#assert np.allclose(img_data_byte.numpy(), to_tensor(img_byte).numpy())
#assert np.allclose(img_data_float.numpy(), to_tensor(img_float).numpy())
def
test_ndarray_to_pil_image
(
self
):
def
test_ndarray_to_pil_image
(
self
):
trans
=
transforms
.
ToPILImage
()
trans
=
transforms
.
ToPILImage
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment