Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Андрей Вуколов
openVINO
Commits
b56cf07f
Unverified
Commit
b56cf07f
authored
4 years ago
by
Mateusz Tabaka
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
[ONNX] remove unnecessary ReduceMax and Subtract in Softmax op (#3717)
parent
7be7a8fb
master
dependabot/pip/ngraph/python/tox-3.21.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ngraph/frontend/onnx_import/src/op/softmax.cpp
+1
-9
ngraph/frontend/onnx_import/src/op/softmax.cpp
ngraph/test/onnx/onnx_import_dyn_shapes.in.cpp
+1
-1
ngraph/test/onnx/onnx_import_dyn_shapes.in.cpp
with
2 additions
and
10 deletions
+2
-10
ngraph/frontend/onnx_import/src/op/softmax.cpp
View file @
b56cf07f
...
...
@@ -31,15 +31,7 @@ namespace ngraph
const
int64_t
axis
)
{
const
auto
coerced_data
=
ngraph
::
builder
::
opset1
::
flatten
(
data
,
axis
);
const
auto
axis_1
=
default_opset
::
Constant
::
create
(
element
::
i64
,
Shape
{
1
},
{
1
});
const
auto
max
=
std
::
make_shared
<
default_opset
::
ReduceMax
>
(
coerced_data
,
axis_1
,
true
);
const
auto
data_minus_max
=
std
::
make_shared
<
default_opset
::
Subtract
>
(
coerced_data
,
max
);
const
auto
result
=
std
::
make_shared
<
default_opset
::
Softmax
>
(
data_minus_max
,
1
);
const
auto
result
=
std
::
make_shared
<
default_opset
::
Softmax
>
(
coerced_data
,
1
);
const
auto
data_shape
=
std
::
make_shared
<
default_opset
::
ShapeOf
>
(
data
);
const
bool
special_zero
=
false
;
return
std
::
make_shared
<
default_opset
::
Reshape
>
(
result
,
data_shape
,
special_zero
);
...
...
This diff is collapsed.
Click to expand it.
ngraph/test/onnx/onnx_import_dyn_shapes.in.cpp
View file @
b56cf07f
...
...
@@ -1142,7 +1142,7 @@ NGRAPH_TEST(${BACKEND_NAME}, onnx_dyn_model_softmax_axis_2)
0.01439711
,
0.70979614
,
0.16515835
,
0.06798343
,
0.2957175
,
0.17468555
,
0.34994439
,
0.11166912
,
0.03615172
,
0.07108136
,
0.08527994
,
0.44775794
,
0.35972905
});
test_case
.
run
(
4
);
test_case
.
run
(
3
);
}
NGRAPH_TEST
(
$
{
BACKEND_NAME
},
onnx_model_range_positive_step
)
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help