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
323f2714
"src/getopt.cpp" did not exist on "22437c6f21f262cf38b8897dbb105acac20c47ff"
Commit
323f2714
authored
May 04, 2018
by
Paul
Browse files
Formatting
parent
f3b6bc41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
onnx/read_onnx.cpp
onnx/read_onnx.cpp
+2
-1
src/program.cpp
src/program.cpp
+7
-7
No files found.
onnx/read_onnx.cpp
View file @
323f2714
...
...
@@ -41,7 +41,8 @@ struct onnx_parser
{
using
attribute_map
=
std
::
unordered_map
<
std
::
string
,
onnx
::
AttributeProto
>
;
using
node_map
=
std
::
unordered_map
<
std
::
string
,
onnx
::
NodeProto
>
;
using
op_func
=
std
::
function
<
rtg
::
instruction_ref
(
attribute_map
,
std
::
vector
<
rtg
::
instruction_ref
>
)
>
;
using
op_func
=
std
::
function
<
rtg
::
instruction_ref
(
attribute_map
,
std
::
vector
<
rtg
::
instruction_ref
>
)
>
;
node_map
nodes
;
std
::
unordered_map
<
std
::
string
,
rtg
::
instruction_ref
>
instructions
;
rtg
::
program
prog
=
rtg
::
program
();
...
...
src/program.cpp
View file @
323f2714
...
...
@@ -20,9 +20,9 @@ program::~program() noexcept = default;
instruction_ref
program
::
add_instruction
(
operation
op
,
std
::
vector
<
instruction_ref
>
args
)
{
assert
(
std
::
all_of
(
args
.
begin
(),
args
.
end
(),
[
&
](
instruction_ref
x
)
{
return
has_instruction
(
x
);
})
&&
"Argument is not an exisiting instruction"
);
assert
(
std
::
all_of
(
args
.
begin
(),
args
.
end
(),
[
&
](
instruction_ref
x
)
{
return
has_instruction
(
x
);
})
&&
"Argument is not an exisiting instruction"
);
std
::
vector
<
shape
>
shapes
(
args
.
size
());
std
::
transform
(
args
.
begin
(),
args
.
end
(),
shapes
.
begin
(),
[](
instruction_ref
ins
)
{
return
ins
->
result
;
});
...
...
@@ -46,10 +46,10 @@ instruction_ref program::add_parameter(std::string name, shape s)
bool
program
::
has_instruction
(
instruction_ref
ins
)
const
{
return
std
::
find_if
(
impl
->
instructions
.
begin
(),
impl
->
instructions
.
end
(),
[
&
](
const
instruction
&
x
)
{
return
std
::
addressof
(
*
ins
)
==
std
::
addressof
(
x
);
})
!=
impl
->
instructions
.
end
();
return
std
::
find_if
(
impl
->
instructions
.
begin
(),
impl
->
instructions
.
end
(),
[
&
](
const
instruction
&
x
)
{
return
std
::
addressof
(
*
ins
)
==
std
::
addressof
(
x
);
})
!=
impl
->
instructions
.
end
();
}
literal
program
::
eval
(
std
::
unordered_map
<
std
::
string
,
argument
>
params
)
const
...
...
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