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
6fa93086
Unverified
Commit
6fa93086
authored
May 21, 2021
by
Nicolas Hug
Committed by
GitHub
May 21, 2021
Browse files
Use torch.testing.assert_close in test_transforms_video.py (#3886)
Co-authored-by:
Philip Meier
<
github.pmeier@posteo.de
>
parent
97b05a89
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
test/test_transforms_video.py
test/test_transforms_video.py
+2
-1
No files found.
test/test_transforms_video.py
View file @
6fa93086
...
@@ -4,6 +4,7 @@ import unittest
...
@@ -4,6 +4,7 @@ import unittest
import
random
import
random
import
numpy
as
np
import
numpy
as
np
import
warnings
import
warnings
from
_assert_utils
import
assert_equal
try
:
try
:
from
scipy
import
stats
from
scipy
import
stats
...
@@ -120,7 +121,7 @@ class TestVideoTransforms(unittest.TestCase):
...
@@ -120,7 +121,7 @@ class TestVideoTransforms(unittest.TestCase):
# Checking the optional in-place behaviour
# Checking the optional in-place behaviour
tensor
=
torch
.
rand
((
3
,
128
,
16
,
16
))
tensor
=
torch
.
rand
((
3
,
128
,
16
,
16
))
tensor_inplace
=
transforms
.
NormalizeVideo
((
0.5
,
0.5
,
0.5
),
(
0.5
,
0.5
,
0.5
),
inplace
=
True
)(
tensor
)
tensor_inplace
=
transforms
.
NormalizeVideo
((
0.5
,
0.5
,
0.5
),
(
0.5
,
0.5
,
0.5
),
inplace
=
True
)(
tensor
)
self
.
assert
True
(
torch
.
equal
(
tensor
,
tensor_inplace
)
)
assert
_
equal
(
tensor
,
tensor_inplace
)
transforms
.
NormalizeVideo
((
0.5
,
0.5
,
0.5
),
(
0.5
,
0.5
,
0.5
),
inplace
=
True
).
__repr__
()
transforms
.
NormalizeVideo
((
0.5
,
0.5
,
0.5
),
(
0.5
,
0.5
,
0.5
),
inplace
=
True
).
__repr__
()
...
...
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