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
3069e199
Unverified
Commit
3069e199
authored
Feb 28, 2019
by
Paul Fultz II
Committed by
GitHub
Feb 28, 2019
Browse files
Merge branch 'develop' into logsoftmax_operator
parents
6590c790
e15b8333
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
src/include/migraphx/literal.hpp
src/include/migraphx/literal.hpp
+2
-2
src/onnx/onnx.cpp
src/onnx/onnx.cpp
+3
-1
No files found.
src/include/migraphx/literal.hpp
View file @
3069e199
...
@@ -22,8 +22,8 @@ struct literal : raw_data<literal>
...
@@ -22,8 +22,8 @@ struct literal : raw_data<literal>
{
{
literal
()
{}
literal
()
{}
template
<
class
U
,
class
T
=
deduce
<
U
>
>
template
<
class
U
,
class
T
=
deduce
<
U
>
,
shape
::
type_t
ShapeType
=
shape
::
get_type
<
T
>
{}
>
literal
(
U
x
)
:
buffer
(
make_shared_array
<
char
>
(
sizeof
(
T
))),
m_shape
(
s
hape
::
get_type
<
T
>
{}
)
literal
(
U
x
)
:
buffer
(
make_shared_array
<
char
>
(
sizeof
(
T
))),
m_shape
(
S
hape
Type
)
{
{
static_assert
(
std
::
is_trivially_copyable
<
T
>
{},
"Literals can only be trivial types"
);
static_assert
(
std
::
is_trivially_copyable
<
T
>
{},
"Literals can only be trivial types"
);
*
(
reinterpret_cast
<
T
*>
(
buffer
.
get
()))
=
x
;
*
(
reinterpret_cast
<
T
*>
(
buffer
.
get
()))
=
x
;
...
...
src/onnx/onnx.cpp
View file @
3069e199
...
@@ -369,7 +369,9 @@ struct onnx_parser
...
@@ -369,7 +369,9 @@ struct onnx_parser
}
}
if
(
args
.
size
()
==
2
)
if
(
args
.
size
()
==
2
)
{
{
literal
s
=
args
[
1
]
->
get_literal
();
auto
s
=
args
[
1
]
->
eval
();
if
(
s
.
empty
())
MIGRAPHX_THROW
(
"Dynamic shape is not supported."
);
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
s
.
visit
([
&
](
auto
v
)
{
copy
(
v
,
std
::
back_inserter
(
op
.
dims
));
});
}
}
return
prog
.
add_instruction
(
op
,
args
[
0
]);
return
prog
.
add_instruction
(
op
,
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