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
5493c90b
Commit
5493c90b
authored
Jun 28, 2019
by
Adam Rogowiec
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addres review comments: refactor class static members name prefix.
parent
0f8c8bf7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
26 deletions
+26
-26
gru_cell.cpp
src/ngraph/op/fused/gru_cell.cpp
+8
-8
gru_cell.hpp
src/ngraph/op/fused/gru_cell.hpp
+1
-1
lstm_cell.cpp
src/ngraph/op/fused/lstm_cell.cpp
+12
-12
lstm_cell.hpp
src/ngraph/op/fused/lstm_cell.hpp
+2
-2
rnn_cell.cpp
src/ngraph/op/fused/rnn_cell.cpp
+2
-2
rnn_cell.hpp
src/ngraph/op/fused/rnn_cell.hpp
+1
-1
No files found.
src/ngraph/op/fused/gru_cell.cpp
View file @
5493c90b
...
...
@@ -111,18 +111,18 @@ void op::GRUCell::pre_validate_and_infer_types()
const
Shape
&
ht_shape
{
ht_pshape
.
to_shape
()};
NODE_VALIDATION_CHECK
(
this
,
(
w_shape
==
Shape
{
m
_gates_count
*
get_hidden_size
(),
input_size
}),
(
w_shape
==
Shape
{
s
_gates_count
*
get_hidden_size
(),
input_size
}),
"Input tensor W must have shape ("
,
m
_gates_count
*
get_hidden_size
(),
s
_gates_count
*
get_hidden_size
(),
", "
,
input_size
,
"). Actual shape is:"
,
w_shape
,
"."
);
NODE_VALIDATION_CHECK
(
this
,
(
r_shape
==
Shape
{
m
_gates_count
*
get_hidden_size
(),
get_hidden_size
()}),
(
r_shape
==
Shape
{
s
_gates_count
*
get_hidden_size
(),
get_hidden_size
()}),
"Input tensor R must have shape ("
,
m
_gates_count
*
get_hidden_size
(),
s
_gates_count
*
get_hidden_size
(),
", "
,
get_hidden_size
(),
"). Actual shape is:"
,
...
...
@@ -146,9 +146,9 @@ void op::GRUCell::pre_validate_and_infer_types()
const
Shape
&
b_shape
{
b_pshape
.
to_shape
()};
NODE_VALIDATION_CHECK
(
this
,
(
b_shape
==
Shape
{
2
*
m
_gates_count
*
get_hidden_size
()}),
(
b_shape
==
Shape
{
2
*
s
_gates_count
*
get_hidden_size
()}),
"Input tensor B must have shape ("
,
2
*
m
_gates_count
*
get_hidden_size
(),
2
*
s
_gates_count
*
get_hidden_size
(),
"). Actual shape is:"
,
b_shape
,
"."
);
...
...
@@ -274,8 +274,8 @@ void op::GRUCell::add_default_bias_input()
{
shared_ptr
<
Node
>
B
=
op
::
Constant
::
create
(
input
(
0
).
get_element_type
(),
Shape
{
2
*
m
_gates_count
*
get_hidden_size
()},
vector
<
float
>
(
2
*
m
_gates_count
*
get_hidden_size
(),
0.
f
));
Shape
{
2
*
s
_gates_count
*
get_hidden_size
()},
vector
<
float
>
(
2
*
s
_gates_count
*
get_hidden_size
(),
0.
f
));
set_argument
(
4
,
B
->
output
(
0
));
}
...
...
src/ngraph/op/fused/gru_cell.hpp
View file @
5493c90b
...
...
@@ -144,7 +144,7 @@ namespace ngraph
///
util
::
ActivationFunction
m_activation_g
;
static
constexpr
std
::
size_t
m
_gates_count
{
3
};
static
constexpr
std
::
size_t
s
_gates_count
{
3
};
///
/// \brief Control whether or not apply the linear transformation.
///
...
...
src/ngraph/op/fused/lstm_cell.cpp
View file @
5493c90b
...
...
@@ -121,18 +121,18 @@ void op::LSTMCell::pre_validate_and_infer_types()
const
Shape
&
ct_shape
{
ct_pshape
.
to_shape
()};
NODE_VALIDATION_CHECK
(
this
,
(
w_shape
==
Shape
{
m
_gates_count
*
get_hidden_size
(),
input_size
}),
(
w_shape
==
Shape
{
s
_gates_count
*
get_hidden_size
(),
input_size
}),
"Input tensor W must have shape ("
,
m
_gates_count
*
get_hidden_size
(),
s
_gates_count
*
get_hidden_size
(),
", "
,
input_size
,
"). Actual shape is:"
,
w_shape
,
"."
);
NODE_VALIDATION_CHECK
(
this
,
(
r_shape
==
Shape
{
m
_gates_count
*
get_hidden_size
(),
get_hidden_size
()}),
(
r_shape
==
Shape
{
s
_gates_count
*
get_hidden_size
(),
get_hidden_size
()}),
"Input tensor R must have shape ("
,
m
_gates_count
*
get_hidden_size
(),
s
_gates_count
*
get_hidden_size
(),
", "
,
get_hidden_size
(),
"). Actual shape is:"
,
...
...
@@ -168,7 +168,7 @@ void op::LSTMCell::pre_validate_and_infer_types()
const
Shape
&
p_shape
{
p_pshape
.
to_shape
()};
NODE_VALIDATION_CHECK
(
this
,
(
b_shape
==
Shape
{
2
*
m
_gates_count
*
get_hidden_size
()}),
(
b_shape
==
Shape
{
2
*
s
_gates_count
*
get_hidden_size
()}),
"Input tensor B must have shape ("
,
8
*
get_hidden_size
(),
"). Actual shape is:"
,
...
...
@@ -176,9 +176,9 @@ void op::LSTMCell::pre_validate_and_infer_types()
"."
);
NODE_VALIDATION_CHECK
(
this
,
(
p_shape
==
Shape
{
m
_peepholes_count
*
get_hidden_size
()}),
(
p_shape
==
Shape
{
s
_peepholes_count
*
get_hidden_size
()}),
"Input tensor P must have shape ("
,
m
_peepholes_count
*
get_hidden_size
(),
s
_peepholes_count
*
get_hidden_size
(),
"). Actual shape is:"
,
p_shape
,
"."
);
...
...
@@ -287,15 +287,15 @@ NodeVector op::LSTMCell::get_peephole_weigths() const
{
shared_ptr
<
Node
>
P
;
P
=
get_argument
(
6
);
return
builder
::
split
(
P
,
m
_peepholes_count
);
return
builder
::
split
(
P
,
s
_peepholes_count
);
}
void
op
::
LSTMCell
::
add_default_bias_input
()
{
shared_ptr
<
Node
>
B
=
op
::
Constant
::
create
(
input
(
0
).
get_element_type
(),
Shape
{
2
*
m
_gates_count
*
get_hidden_size
()},
vector
<
float
>
(
2
*
m
_gates_count
*
get_hidden_size
(),
0.
f
));
Shape
{
2
*
s
_gates_count
*
get_hidden_size
()},
vector
<
float
>
(
2
*
s
_gates_count
*
get_hidden_size
(),
0.
f
));
set_argument
(
5
,
B
->
output
(
0
));
}
...
...
@@ -303,8 +303,8 @@ void op::LSTMCell::add_default_peepholes_input()
{
shared_ptr
<
Node
>
P
=
op
::
Constant
::
create
(
input
(
0
).
get_element_type
(),
Shape
{
m
_peepholes_count
*
get_hidden_size
()},
vector
<
float
>
(
m
_peepholes_count
*
get_hidden_size
(),
0.
f
));
Shape
{
s
_peepholes_count
*
get_hidden_size
()},
vector
<
float
>
(
s
_peepholes_count
*
get_hidden_size
(),
0.
f
));
set_argument
(
6
,
P
->
output
(
0
));
}
...
...
src/ngraph/op/fused/lstm_cell.hpp
View file @
5493c90b
...
...
@@ -168,8 +168,8 @@ namespace ngraph
///
bool
m_input_forget
=
false
;
static
constexpr
std
::
size_t
m
_gates_count
{
4
};
static
constexpr
std
::
size_t
m
_peepholes_count
{
3
};
static
constexpr
std
::
size_t
s
_gates_count
{
4
};
static
constexpr
std
::
size_t
s
_peepholes_count
{
3
};
};
}
}
src/ngraph/op/fused/rnn_cell.cpp
View file @
5493c90b
...
...
@@ -199,8 +199,8 @@ void op::RNNCell::add_default_bias_input()
{
shared_ptr
<
Node
>
B
=
op
::
Constant
::
create
(
input
(
0
).
get_element_type
(),
Shape
{
2
*
m
_gates_count
*
get_hidden_size
()},
vector
<
float
>
(
2
*
m
_gates_count
*
get_hidden_size
(),
0.
f
));
Shape
{
2
*
s
_gates_count
*
get_hidden_size
()},
vector
<
float
>
(
2
*
s
_gates_count
*
get_hidden_size
(),
0.
f
));
set_argument
(
4
,
B
->
output
(
0
));
}
...
...
src/ngraph/op/fused/rnn_cell.hpp
View file @
5493c90b
...
...
@@ -134,7 +134,7 @@ namespace ngraph
///
util
::
ActivationFunction
m_activation_f
;
static
constexpr
std
::
size_t
m
_gates_count
{
1
};
static
constexpr
std
::
size_t
s
_gates_count
{
1
};
};
}
}
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