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
d4d2335a
Commit
d4d2335a
authored
Apr 29, 2019
by
Shucai Xiao
Browse files
merge changes from pr propogate_const
parents
2820afff
a81af777
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
src/include/migraphx/op/binary.hpp
src/include/migraphx/op/binary.hpp
+9
-4
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 @
d4d2335a
...
@@ -13,11 +13,16 @@ struct binary : op_name<Derived>
...
@@ -13,11 +13,16 @@ struct binary : op_name<Derived>
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
();
const
auto
&
s
=
inputs
.
front
();
if
(
inputs
.
at
(
0
)
==
inputs
.
at
(
1
)
and
inputs
.
at
(
0
).
packed
())
if
(
s
.
scalar
()
and
s
.
elements
()
==
1
)
{
return
{
s
.
type
()};
return
inputs
.
at
(
0
);
return
{
s
.
type
(),
s
.
lens
()};
}
else
{
return
{
inputs
.
at
(
0
).
type
(),
inputs
.
at
(
0
).
lens
()};
}
}
}
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
{
{
argument
result
{
output_shape
};
argument
result
{
output_shape
};
...
...
src/include/migraphx/op/unary.hpp
View file @
d4d2335a
...
@@ -13,7 +13,15 @@ struct unary : op_name<Derived>
...
@@ -13,7 +13,15 @@ struct unary : op_name<Derived>
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
()};
}
}
}
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
const
argument
compute
(
const
shape
&
output_shape
,
std
::
vector
<
argument
>
args
)
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