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
gaoqiong
MIGraphX
Commits
74f9b2e8
Commit
74f9b2e8
authored
May 18, 2023
by
umangyadav
Browse files
Print tolerance and failed elements
parent
1c6c061b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
tools/accuracy/accuracy_checker.py
tools/accuracy/accuracy_checker.py
+11
-1
No files found.
tools/accuracy/accuracy_checker.py
View file @
74f9b2e8
...
...
@@ -96,7 +96,8 @@ def parse_args():
help
=
'Save output of ORT as numpy array at path provided by this argument'
)
args
=
parser
.
parse_args
()
if
args
.
verbose
:
print
(
"Tolerance is set at {args.tolerance}"
)
return
args
...
...
@@ -115,6 +116,15 @@ def check_correctness(gold_outputs,
ret
=
True
for
i
in
range
(
out_num
):
if
not
np
.
allclose
(
gold_outputs
[
i
],
outputs
[
i
],
rtol
,
atol
):
failed_idx
=
~
np
.
isclose
(
gold_outputs
[
i
],
outputs
[
i
],
rtol
,
atol
)
if
verbose
:
print
(
"Shape of Failed elements{} :
\n
"
.
format
(
gold_outputs
[
i
][
failed_idx
].
shape
))
print
(
"Expected :
\n
{}"
.
format
(
gold_outputs
[
i
][
failed_idx
].
tolist
()[
0
:
400
:
5
]))
print
(
'......'
)
print
(
"Actual
\n
{}"
.
format
(
outputs
[
i
][
failed_idx
].
tolist
()[
0
:
400
:
5
]))
ret
=
False
if
verbose
:
print
(
'
\n
Output {} is incorrect ...'
.
format
(
i
))
...
...
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