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
0f770ac9
Unverified
Commit
0f770ac9
authored
Oct 27, 2021
by
Vasilis Vryniotis
Committed by
GitHub
Oct 27, 2021
Browse files
Setting seeds for TestRoiPool backward. (#4763)
parent
5ffba76f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
test/test_ops.py
test/test_ops.py
+3
-1
No files found.
test/test_ops.py
View file @
0f770ac9
...
...
@@ -46,9 +46,11 @@ class RoIOpTester(ABC):
tol
=
1e-3
if
(
x_dtype
is
torch
.
half
or
rois_dtype
is
torch
.
half
)
else
1e-5
torch
.
testing
.
assert_close
(
gt_y
.
to
(
y
),
y
,
rtol
=
tol
,
atol
=
tol
)
@
pytest
.
mark
.
parametrize
(
"seed"
,
range
(
10
))
@
pytest
.
mark
.
parametrize
(
"device"
,
cpu_and_gpu
())
@
pytest
.
mark
.
parametrize
(
"contiguous"
,
(
True
,
False
))
def
test_backward
(
self
,
device
,
contiguous
):
def
test_backward
(
self
,
seed
,
device
,
contiguous
):
torch
.
random
.
manual_seed
(
seed
)
pool_size
=
2
x
=
torch
.
rand
(
1
,
2
*
(
pool_size
**
2
),
5
,
5
,
dtype
=
self
.
dtype
,
device
=
device
,
requires_grad
=
True
)
if
not
contiguous
:
...
...
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