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
924d373c
Unverified
Commit
924d373c
authored
Mar 01, 2023
by
Philip Meier
Committed by
GitHub
Mar 01, 2023
Browse files
fix flaky test for rotate_bounding_box (#7362)
Co-authored-by:
Nicolas Hug
<
contact@nicolas-hug.com
>
parent
feda8b7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
test/common_utils.py
test/common_utils.py
+1
-1
test/test_transforms_v2_functional.py
test/test_transforms_v2_functional.py
+4
-4
test/transforms_v2_kernel_infos.py
test/transforms_v2_kernel_infos.py
+2
-2
No files found.
test/common_utils.py
View file @
924d373c
...
...
@@ -351,7 +351,7 @@ assert_equal = functools.partial(assert_close, rtol=0, atol=0)
def
parametrized_error_message
(
*
args
,
**
kwargs
):
def
to_str
(
obj
):
if
isinstance
(
obj
,
torch
.
Tensor
)
and
obj
.
numel
()
>
1
0
:
if
isinstance
(
obj
,
torch
.
Tensor
)
and
obj
.
numel
()
>
3
0
:
return
f
"tensor(shape=
{
list
(
obj
.
shape
)
}
, dtype=
{
obj
.
dtype
}
, device=
{
obj
.
device
}
)"
elif
isinstance
(
obj
,
enum
.
Enum
):
return
f
"
{
type
(
obj
).
__name__
}
.
{
obj
.
name
}
"
...
...
test/test_transforms_v2_functional.py
View file @
924d373c
...
...
@@ -146,7 +146,7 @@ class TestKernels:
actual
,
expected
,
**
info
.
get_closeness_kwargs
(
test_id
,
dtype
=
input
.
dtype
,
device
=
input
.
device
),
msg
=
parametrized_error_message
(
*
([
actual
,
expected
]
+
other_args
)
,
**
kwargs
),
msg
=
parametrized_error_message
(
input
,
other_args
,
**
kwargs
),
)
def
_unbatch
(
self
,
batch
,
*
,
data_dims
):
...
...
@@ -204,7 +204,7 @@ class TestKernels:
actual
,
expected
,
**
info
.
get_closeness_kwargs
(
test_id
,
dtype
=
batched_input
.
dtype
,
device
=
batched_input
.
device
),
msg
=
parametrized_error_message
(
*
other_args
,
**
kwargs
),
msg
=
parametrized_error_message
(
batched_input
,
*
other_args
,
**
kwargs
),
)
@
sample_inputs
...
...
@@ -236,7 +236,7 @@ class TestKernels:
output_cpu
,
check_device
=
False
,
**
info
.
get_closeness_kwargs
(
test_id
,
dtype
=
input_cuda
.
dtype
,
device
=
input_cuda
.
device
),
msg
=
parametrized_error_message
(
*
other_args
,
**
kwargs
),
msg
=
parametrized_error_message
(
input_cpu
,
*
other_args
,
**
kwargs
),
)
@
sample_inputs
...
...
@@ -294,7 +294,7 @@ class TestKernels:
actual
,
expected
,
**
info
.
get_closeness_kwargs
(
test_id
,
dtype
=
torch
.
float32
,
device
=
input
.
device
),
msg
=
parametrized_error_message
(
*
other_args
,
**
kwargs
),
msg
=
parametrized_error_message
(
input
,
*
other_args
,
**
kwargs
),
)
...
...
test/transforms_v2_kernel_infos.py
View file @
924d373c
...
...
@@ -860,8 +860,8 @@ KERNEL_INFOS.extend(
reference_fn
=
reference_rotate_bounding_box
,
reference_inputs_fn
=
reference_inputs_rotate_bounding_box
,
closeness_kwargs
=
{
**
scripted_vs_eager_float64_tolerances
(
"cpu"
,
atol
=
1e-
6
,
rtol
=
1e-
6
),
**
scripted_vs_eager_float64_tolerances
(
"cuda"
,
atol
=
1e-
5
,
rtol
=
1e-
5
),
**
scripted_vs_eager_float64_tolerances
(
"cpu"
,
atol
=
1e-
4
,
rtol
=
1e-
4
),
**
scripted_vs_eager_float64_tolerances
(
"cuda"
,
atol
=
1e-
4
,
rtol
=
1e-
4
),
},
),
KernelInfo
(
...
...
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