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
85b35f92
Commit
85b35f92
authored
Jul 09, 2019
by
Shucai Xiao
Browse files
clang format
parent
6cda085f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+17
-15
No files found.
src/onnx/onnx.cpp
View file @
85b35f92
...
...
@@ -260,15 +260,16 @@ struct onnx_parser
return
prog
.
add_instruction
(
op
,
std
::
move
(
args
));
}
// instruction_ref
// parse_softmax(const std::string&, const attribute_map&, std::vector<instruction_ref> args)
// {
// auto dims = args.front()->get_shape().lens();
// auto r =
// prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1]), 1, 1}}, args.front());
// auto s = prog.add_instruction(op::softmax{}, r);
// return prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1])}}, s);
// }
// instruction_ref
// parse_softmax(const std::string&, const attribute_map&, std::vector<instruction_ref> args)
// {
// auto dims = args.front()->get_shape().lens();
// auto r =
// prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1]), 1, 1}},
// args.front());
// auto s = prog.add_instruction(op::softmax{}, r);
// return prog.add_instruction(op::reshape{{long(dims[0]), long(dims[1])}}, s);
// }
instruction_ref
parse_softmax
(
const
std
::
string
&
,
const
attribute_map
&
attributes
,
...
...
@@ -473,14 +474,15 @@ struct onnx_parser
op
::
reshape
op
;
if
(
args
.
size
()
==
1
)
{
if
(
contains
(
attributes
,
"shape"
))
if
(
contains
(
attributes
,
"shape"
))
{
literal
s
=
parse_value
(
attributes
.
at
(
"shape"
));
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
}
else
{
MIGRAPHX_THROW
(
"Parse_reshape: shape attribute is needed when only one argument is provided!"
);
MIGRAPHX_THROW
(
"Parse_reshape: shape attribute is needed when only one argument is provided!"
);
}
}
if
(
args
.
size
()
==
2
)
...
...
@@ -491,7 +493,7 @@ struct onnx_parser
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
}
if
(
!
args
[
0
]
->
get_shape
().
standard
())
if
(
!
args
[
0
]
->
get_shape
().
standard
())
{
args
[
0
]
=
prog
.
add_instruction
(
op
::
contiguous
{},
args
[
0
]);
}
...
...
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