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
19bc41fc
Commit
19bc41fc
authored
Apr 29, 2019
by
Shucai Xiao
Browse files
change the return shape to make it consistent in all places.
parent
d4c89abc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
src/include/migraphx/op/binary.hpp
src/include/migraphx/op/binary.hpp
+8
-1
src/include/migraphx/op/unary.hpp
src/include/migraphx/op/unary.hpp
+9
-1
No files found.
src/include/migraphx/op/binary.hpp
View file @
19bc41fc
...
@@ -21,8 +21,15 @@ struct binary
...
@@ -21,8 +21,15 @@ struct binary
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
check_shapes
{
inputs
}.
has
(
2
).
same_type
().
same_dims
();
check_shapes
{
inputs
}.
has
(
2
).
same_type
().
same_dims
();
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
())
{
return
inputs
.
at
(
0
);
return
inputs
.
at
(
0
);
}
}
else
{
return
{
inputs
.
at
(
0
).
type
(),
inputs
.
at
(
0
).
lens
()};
}
}
};
};
}
// namespace op
}
// namespace op
...
...
src/include/migraphx/op/unary.hpp
View file @
19bc41fc
...
@@ -21,7 +21,15 @@ struct unary
...
@@ -21,7 +21,15 @@ struct unary
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
check_shapes
{
inputs
}.
has
(
1
);
check_shapes
{
inputs
}.
has
(
1
);
return
inputs
.
at
(
0
);
auto
s
=
inputs
.
at
(
0
);
if
(
s
.
packed
())
{
return
s
;
}
else
{
return
{
s
.
type
(),
s
.
lens
()};
}
}
}
};
};
...
...
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