Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
d771f6b5
Commit
d771f6b5
authored
Nov 09, 2018
by
Scott Thornton
Browse files
Formatting
parent
1f304aed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/include/migraph/operators.hpp
src/include/migraph/operators.hpp
+7
-7
No files found.
src/include/migraph/operators.hpp
View file @
d771f6b5
...
@@ -777,19 +777,19 @@ struct multibroadcast
...
@@ -777,19 +777,19 @@ struct multibroadcast
auto
t
=
inputs
.
at
(
0
).
type
();
auto
t
=
inputs
.
at
(
0
).
type
();
auto
input
=
inputs
.
at
(
0
);
auto
input
=
inputs
.
at
(
0
);
if
(
input
.
lens
().
size
()
<=
0
)
if
(
input
.
lens
().
size
()
<=
0
)
MIGRAPH_THROW
(
"inputs dimensions should be > 0"
);
MIGRAPH_THROW
(
"inputs dimensions should be > 0"
);
if
(
input
.
lens
().
size
()
>
output_lens
.
size
())
if
(
input
.
lens
().
size
()
>
output_lens
.
size
())
MIGRAPH_THROW
(
"inputs dimensions should <= output size"
);
MIGRAPH_THROW
(
"inputs dimensions should <= output size"
);
std
::
vector
<
size_t
>
bcast_strides
(
output_lens
.
size
(),
0
);
std
::
vector
<
size_t
>
bcast_strides
(
output_lens
.
size
(),
0
);
auto
offset
=
output_lens
.
size
()
-
input
.
lens
().
size
();
auto
offset
=
output_lens
.
size
()
-
input
.
lens
().
size
();
for
(
int
i
=
input
.
lens
().
size
()
-
1
;
i
>=
0
;
i
--
)
for
(
int
i
=
input
.
lens
().
size
()
-
1
;
i
>=
0
;
i
--
)
{
{
if
(
output_lens
[
i
+
offset
]
==
input
.
lens
()[
i
])
if
(
output_lens
[
i
+
offset
]
==
input
.
lens
()[
i
])
{
{
bcast_strides
[
i
+
offset
]
=
input
.
strides
()[
i
];
bcast_strides
[
i
+
offset
]
=
input
.
strides
()[
i
];
}
}
}
}
return
{
t
,
output_lens
,
bcast_strides
};
return
{
t
,
output_lens
,
bcast_strides
};
...
@@ -828,7 +828,7 @@ struct binary
...
@@ -828,7 +828,7 @@ 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
();
auto
t
=
inputs
.
at
(
0
).
type
();
auto
t
=
inputs
.
at
(
0
).
type
();
auto
lens
=
inputs
.
at
(
0
).
lens
();
auto
lens
=
inputs
.
at
(
0
).
lens
();
return
{
t
,
lens
};
return
{
t
,
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