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
a40c5f4a
Commit
a40c5f4a
authored
May 31, 2019
by
Khalique
Browse files
fix edge case for dims=1
parent
7f7cbbc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/targets/cpu/lowering.cpp
src/targets/cpu/lowering.cpp
+2
-2
No files found.
src/targets/cpu/lowering.cpp
View file @
a40c5f4a
...
...
@@ -533,7 +533,7 @@ struct cpu_softmax
template
<
typename
T
>
std
::
size_t
compute_batch_index
(
T
idx
,
shape
&
batch_shape
,
int
axis
)
const
{
idx
.
erase
(
idx
.
begin
()
+
axis
)
;
idx
[
axis
]
=
0
;
return
batch_shape
.
index
(
idx
);
}
...
...
@@ -541,7 +541,7 @@ struct cpu_softmax
{
argument
result
{
output_shape
};
auto
batch_lens
=
output_shape
.
lens
();
batch_lens
.
erase
(
batch_lens
.
begin
()
+
op
.
axis
)
;
batch_lens
[
op
.
axis
]
=
1
;
shape
batch_shape
{
shape
::
int32_type
,
batch_lens
};
visit_all
(
result
,
args
[
0
])([
&
](
auto
output
,
auto
input
)
{
...
...
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