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
981bd143
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "9879574a6b549bbf8aadc741d65ae2c8c079255d"
Commit
981bd143
authored
Jun 19, 2018
by
Paul
Browse files
Formatting
parent
3362f2fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
src/include/rtg/operators.hpp
src/include/rtg/operators.hpp
+6
-6
test/cpu_ops_test.cpp
test/cpu_ops_test.cpp
+3
-3
No files found.
src/include/rtg/operators.hpp
View file @
981bd143
...
@@ -426,13 +426,13 @@ struct broadcast
...
@@ -426,13 +426,13 @@ struct broadcast
std
::
string
name
()
const
{
return
"broadcast"
;
}
std
::
string
name
()
const
{
return
"broadcast"
;
}
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
shape
compute_shape
(
std
::
vector
<
shape
>
inputs
)
const
{
{
auto
t
=
inputs
.
at
(
0
).
type
();
auto
t
=
inputs
.
at
(
0
).
type
();
auto
shape0
=
inputs
.
at
(
0
);
auto
shape0
=
inputs
.
at
(
0
);
auto
shape1
=
inputs
.
at
(
1
);
auto
shape1
=
inputs
.
at
(
1
);
auto
shape0_lens
=
shape0
.
lens
();
auto
shape0_lens
=
shape0
.
lens
();
auto
shape1_lens
=
shape1
.
lens
();
auto
shape1_lens
=
shape1
.
lens
();
const
auto
&
shape0_strides
=
shape0
.
lens
();
const
auto
&
shape0_strides
=
shape0
.
lens
();
auto
shape1_strides
=
shape1
.
lens
();
auto
shape1_strides
=
shape1
.
lens
();
if
(
std
::
all_of
(
shape0_lens
.
cbegin
(),
shape1_lens
.
cend
(),
[
&
](
auto
x
)
{
return
x
==
1
;
}))
if
(
std
::
all_of
(
shape0_lens
.
cbegin
(),
shape1_lens
.
cend
(),
[
&
](
auto
x
)
{
return
x
==
1
;
}))
{
{
if
(
axis
!=
0
)
if
(
axis
!=
0
)
...
...
test/cpu_ops_test.cpp
View file @
981bd143
...
@@ -11,10 +11,10 @@ void fred()
...
@@ -11,10 +11,10 @@ void fred()
size_t
axis
=
1
;
size_t
axis
=
1
;
rtg
::
shape
shape0
{
rtg
::
shape
::
float_type
,
{
2
,
4
,
3
,
4
}};
rtg
::
shape
shape0
{
rtg
::
shape
::
float_type
,
{
2
,
4
,
3
,
4
}};
rtg
::
shape
shape1
{
rtg
::
shape
::
float_type
,
{
4
,
3
}};
rtg
::
shape
shape1
{
rtg
::
shape
::
float_type
,
{
4
,
3
}};
std
::
vector
<
size_t
>
shape0_lens
=
shape0
.
lens
();
std
::
vector
<
size_t
>
shape0_lens
=
shape0
.
lens
();
std
::
vector
<
size_t
>
shape1_lens
=
shape1
.
lens
();
std
::
vector
<
size_t
>
shape1_lens
=
shape1
.
lens
();
const
std
::
vector
<
size_t
>&
shape0_strides
=
shape0
.
strides
();
const
std
::
vector
<
size_t
>&
shape0_strides
=
shape0
.
strides
();
std
::
vector
<
size_t
>
shape1_strides
=
shape1
.
strides
();
std
::
vector
<
size_t
>
shape1_strides
=
shape1
.
strides
();
for
(
size_t
i
=
0
;
i
<
shape1
.
lens
().
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
shape1
.
lens
().
size
();
i
++
)
{
{
assert
(
shape0_lens
[
i
+
axis
]
==
shape1_lens
[
i
]);
assert
(
shape0_lens
[
i
+
axis
]
==
shape1_lens
[
i
]);
...
...
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