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
bb13878f
Commit
bb13878f
authored
Jun 11, 2018
by
Scott Thornton
Browse files
Added same_ndims() in check_shapes
parent
81b0631e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
src/include/rtg/operators.hpp
src/include/rtg/operators.hpp
+8
-1
No files found.
src/include/rtg/operators.hpp
View file @
bb13878f
...
...
@@ -56,6 +56,13 @@ struct check_shapes
return
*
this
;
}
const
check_shapes
&
same_ndims
()
const
{
if
(
!
this
->
same
([](
const
shape
&
s
)
{
return
s
.
lens
().
size
();
}))
RTG_THROW
(
"Dimensions do not match"
);
return
*
this
;
}
template
<
class
F
>
bool
same
(
F
f
)
const
{
...
...
@@ -87,7 +94,7 @@ struct convolution
std
::
string
name
()
const
{
return
"convolution"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
check_shapes
{
inputs
}.
has
(
2
).
same_type
().
same_dims
().
only_dims
(
4
);
check_shapes
{
inputs
}.
has
(
2
).
same_type
().
same_
n
dims
().
only_dims
(
4
);
const
shape
&
input
=
inputs
.
at
(
0
);
const
shape
&
weights
=
inputs
.
at
(
1
);
...
...
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