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
c0bab0a6
Commit
c0bab0a6
authored
Aug 27, 2019
by
Paul
Browse files
Use replace_if
parent
dec385e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+3
-3
No files found.
src/onnx/onnx.cpp
View file @
c0bab0a6
...
...
@@ -1546,9 +1546,9 @@ struct onnx_parser
literal
s
=
parse_value
(
attr
);
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
result
));
});
// Clamp large indices to -1
for
(
auto
&&
x
:
result
)
if
(
x
>
int64_t
{
std
::
numeric_limits
<
std
::
int32_t
>::
max
()}
/
2
)
x
=
-
1
;
std
::
replace_if
(
result
.
begin
(),
result
.
end
(),
[](
auto
x
)
{
return
x
>
int64_t
{
std
::
numeric_limits
<
std
::
int32_t
>::
max
()}
/
2
;
},
-
1
)
;
return
result
;
}
...
...
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