Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
ef1c5347
Commit
ef1c5347
authored
May 20, 2019
by
Adam Rogowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LSTM cell fused operator.
parent
03dba84d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
2 deletions
+43
-2
CMakeLists.txt
src/ngraph/CMakeLists.txt
+6
-0
CMakeLists.txt
src/ngraph/frontend/onnx_import/CMakeLists.txt
+0
-2
ngraph.hpp
src/ngraph/ngraph.hpp
+1
-0
lstm_cell.cpp
src/ngraph/op/fused/lstm_cell.cpp
+0
-0
lstm_cell.hpp
src/ngraph/op/fused/lstm_cell.hpp
+0
-0
fused_op_tbl.hpp
src/ngraph/op/fused_op_tbl.hpp
+1
-0
serializer.cpp
src/ngraph/serializer.cpp
+35
-0
No files found.
src/ngraph/CMakeLists.txt
View file @
ef1c5347
...
...
@@ -302,12 +302,16 @@ set (SRC
op/fused/grn.hpp
op/fused/group_conv.hpp
op/fused/group_conv.cpp
op/fused/lstm_cell.cpp
op/fused/lstm_cell.hpp
op/fused/mvn.cpp
op/fused/mvn.hpp
op/fused/normalize.cpp
op/fused/normalize.hpp
op/fused/prelu.cpp
op/fused/prelu.hpp
op/fused/rnn_cell_base.cpp
op/fused/rnn_cell_base.hpp
op/fused/scale_shift.cpp
op/fused/scale_shift.hpp
op/fused/space_to_depth.cpp
...
...
@@ -320,6 +324,8 @@ set (SRC
op/fused/squeeze.hpp
op/fused/unsqueeze.cpp
op/fused/unsqueeze.hpp
op/util/activation_functions.cpp
op/util/activation_functions.hpp
op/util/arithmetic_reduction.cpp
op/util/arithmetic_reduction.hpp
op/util/binary_elementwise_arithmetic.cpp
...
...
src/ngraph/frontend/onnx_import/CMakeLists.txt
View file @
ef1c5347
...
...
@@ -189,8 +189,6 @@ add_library(onnx_import STATIC
utils/reduction.hpp
utils/reshape.cpp
utils/reshape.hpp
utils/rnn/activation_functions.cpp
utils/rnn/activation_functions.hpp
utils/variadic.hpp
)
set
(
ONNX_IMPORT_INCLUDE_DIR
${
CMAKE_CURRENT_SOURCE_DIR
}
CACHE INTERNAL
""
)
...
...
src/ngraph/ngraph.hpp
View file @
ef1c5347
...
...
@@ -103,6 +103,7 @@
#include "ngraph/op/fused/grn.hpp"
#include "ngraph/op/fused/group_conv.hpp"
#include "ngraph/op/fused/hard_sigmoid.hpp"
#include "ngraph/op/fused/lstm_cell.hpp"
#include "ngraph/op/fused/mvn.hpp"
#include "ngraph/op/fused/normalize.hpp"
#include "ngraph/op/fused/prelu.hpp"
...
...
src/ngraph/op/fused/lstm_cell.cpp
0 → 100644
View file @
ef1c5347
This diff is collapsed.
Click to expand it.
src/ngraph/op/fused/lstm_cell.hpp
0 → 100644
View file @
ef1c5347
This diff is collapsed.
Click to expand it.
src/ngraph/op/fused_op_tbl.hpp
View file @
ef1c5347
...
...
@@ -27,6 +27,7 @@ NGRAPH_OP(GRN, ngraph::op)
NGRAPH_OP
(
Gemm
,
ngraph
::
op
)
NGRAPH_OP
(
GroupConvolution
,
ngraph
::
op
)
NGRAPH_OP
(
HardSigmoid
,
ngraph
::
op
)
NGRAPH_OP
(
LSTMCell
,
ngraph
::
op
)
NGRAPH_OP
(
MVN
,
ngraph
::
op
)
NGRAPH_OP
(
Normalize
,
ngraph
::
op
)
NGRAPH_OP
(
PRelu
,
ngraph
::
op
)
...
...
src/ngraph/serializer.cpp
View file @
ef1c5347
...
...
@@ -74,6 +74,7 @@
#include "ngraph/op/fused/grn.hpp"
#include "ngraph/op/fused/group_conv.hpp"
#include "ngraph/op/fused/hard_sigmoid.hpp"
#include "ngraph/op/fused/lstm_cell.hpp"
#include "ngraph/op/fused/mvn.hpp"
#include "ngraph/op/fused/normalize.hpp"
#include "ngraph/op/fused/prelu.hpp"
...
...
@@ -1055,6 +1056,29 @@ static shared_ptr<ngraph::Function>
node
=
make_shared
<
op
::
LRN
>
(
args
[
0
],
alpha
,
beta
,
bias
,
nsize
);
break
;
}
case
OP_TYPEID
:
:
LSTMCell
:
{
auto
hidden_size
=
node_js
.
at
(
"hidden_size"
).
get
<
size_t
>
();
auto
clip
=
node_js
.
at
(
"clip"
).
get
<
float
>
();
auto
activations
=
node_js
.
at
(
"activations"
).
get
<
vector
<
string
>>
();
auto
activation_alpha
=
node_js
.
at
(
"activation_alpha"
).
get
<
vector
<
float
>>
();
auto
activation_beta
=
node_js
.
at
(
"activation_beta"
).
get
<
vector
<
float
>>
();
auto
input_forget
=
node_js
.
at
(
"input_forget"
).
get
<
bool
>
();
node
=
make_shared
<
op
::
LSTMCell
>
(
args
[
0
],
args
[
1
],
args
[
2
],
args
[
3
],
args
[
4
],
hidden_size
,
args
[
5
],
args
[
6
],
activations
,
activation_alpha
,
activation_beta
,
clip
,
input_forget
);
break
;
}
case
OP_TYPEID
:
:
Max
:
{
auto
reduction_axes
=
node_js
.
at
(
"reduction_axes"
).
get
<
set
<
size_t
>>
();
...
...
@@ -1979,6 +2003,17 @@ static json write(const Node& n, bool binary_constant_data)
node
[
"nsize"
]
=
tmp
->
get_nsize
();
break
;
}
case
OP_TYPEID
:
:
LSTMCell
:
{
auto
tmp
=
dynamic_cast
<
const
op
::
LSTMCell
*>
(
&
n
);
node
[
"hidden_size"
]
=
tmp
->
get_hidden_size
();
node
[
"clip"
]
=
tmp
->
get_clip
();
node
[
"activations"
]
=
tmp
->
get_activations
();
node
[
"activation_alpha"
]
=
tmp
->
get_activation_alpha
();
node
[
"activation_beta"
]
=
tmp
->
get_activation_beta
();
node
[
"input_forget"
]
=
tmp
->
get_input_forget
();
break
;
}
case
OP_TYPEID
:
:
Max
:
{
auto
tmp
=
dynamic_cast
<
const
op
::
Max
*>
(
&
n
);
...
...
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