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
2ecf283b
Commit
2ecf283b
authored
May 24, 2019
by
Adam Rogowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Clamp inside RNNCellBase clip.
parent
5136e1b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
rnn_cell_base.cpp
src/ngraph/op/fused/rnn_cell_base.cpp
+2
-9
No files found.
src/ngraph/op/fused/rnn_cell_base.cpp
View file @
2ecf283b
...
...
@@ -19,6 +19,7 @@
#include "ngraph/op/add.hpp"
#include "ngraph/op/constant.hpp"
#include "ngraph/op/fused/clamp.hpp"
#include "ngraph/op/fused/rnn_cell_base.hpp"
#include "ngraph/op/maximum.hpp"
#include "ngraph/op/minimum.hpp"
...
...
@@ -93,13 +94,5 @@ shared_ptr<Node> op::RNNCellBase::clip(const shared_ptr<Node>& data) const
return
data
;
}
float
min_val
=
-
m_clip
;
float
max_val
=
m_clip
;
size_t
size
=
shape_size
(
data
->
get_shape
());
const
shared_ptr
<
Node
>
min_val_node
=
op
::
Constant
::
create
(
data
->
get_element_type
(),
data
->
get_shape
(),
vector
<
float
>
(
size
,
min_val
));
const
shared_ptr
<
Node
>
max_val_node
=
op
::
Constant
::
create
(
data
->
get_element_type
(),
data
->
get_shape
(),
vector
<
float
>
(
size
,
max_val
));
return
make_shared
<
op
::
Minimum
>
(
max_val_node
,
make_shared
<
op
::
Maximum
>
(
data
,
min_val_node
));
return
make_shared
<
op
::
Clamp
>
(
data
,
-
m_clip
,
m_clip
);
}
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