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
chenpangpang
transformers
Commits
b03be78a
Unverified
Commit
b03be78a
authored
Jun 24, 2022
by
Yih-Dar
Committed by
GitHub
Jun 24, 2022
Browse files
Fix `test_inference_instance_segmentation_head` (#17872)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
494aac65
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
tests/models/maskformer/test_modeling_maskformer.py
tests/models/maskformer/test_modeling_maskformer.py
+6
-3
No files found.
tests/models/maskformer/test_modeling_maskformer.py
View file @
b03be78a
...
@@ -387,9 +387,12 @@ class MaskFormerModelIntegrationTest(unittest.TestCase):
...
@@ -387,9 +387,12 @@ class MaskFormerModelIntegrationTest(unittest.TestCase):
self
.
assertEqual
(
self
.
assertEqual
(
masks_queries_logits
.
shape
,
(
1
,
model
.
config
.
num_queries
,
inputs_shape
[
-
2
]
//
4
,
inputs_shape
[
-
1
]
//
4
)
masks_queries_logits
.
shape
,
(
1
,
model
.
config
.
num_queries
,
inputs_shape
[
-
2
]
//
4
,
inputs_shape
[
-
1
]
//
4
)
)
)
expected_slice
=
torch
.
tensor
(
expected_slice
=
[
[[
-
1.3738
,
-
1.7725
,
-
1.9365
],
[
-
1.5978
,
-
1.9869
,
-
2.1524
],
[
-
1.5796
,
-
1.9271
,
-
2.0940
]]
[
-
1.3737124
,
-
1.7724937
,
-
1.9364233
],
).
to
(
torch_device
)
[
-
1.5977281
,
-
1.9867939
,
-
2.1523695
],
[
-
1.5795398
,
-
1.9269832
,
-
2.093942
],
]
expected_slice
=
torch
.
tensor
(
expected_slice
).
to
(
torch_device
)
self
.
assertTrue
(
torch
.
allclose
(
masks_queries_logits
[
0
,
0
,
:
3
,
:
3
],
expected_slice
,
atol
=
TOLERANCE
))
self
.
assertTrue
(
torch
.
allclose
(
masks_queries_logits
[
0
,
0
,
:
3
,
:
3
],
expected_slice
,
atol
=
TOLERANCE
))
# class_queries_logits
# class_queries_logits
class_queries_logits
=
outputs
.
class_queries_logits
class_queries_logits
=
outputs
.
class_queries_logits
...
...
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