Commit 5493c90b authored by Adam Rogowiec's avatar Adam Rogowiec

Addres review comments: refactor class static members name prefix.

parent 0f8c8bf7
...@@ -111,18 +111,18 @@ void op::GRUCell::pre_validate_and_infer_types() ...@@ -111,18 +111,18 @@ void op::GRUCell::pre_validate_and_infer_types()
const Shape& ht_shape{ht_pshape.to_shape()}; const Shape& ht_shape{ht_pshape.to_shape()};
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor W must have shape (",
m_gates_count * get_hidden_size(), s_gates_count * get_hidden_size(),
", ", ", ",
input_size, input_size,
"). Actual shape is:", "). Actual shape is:",
w_shape, w_shape,
"."); ".");
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor R must have shape (",
m_gates_count * get_hidden_size(), s_gates_count * get_hidden_size(),
", ", ", ",
get_hidden_size(), get_hidden_size(),
"). Actual shape is:", "). Actual shape is:",
...@@ -146,9 +146,9 @@ void op::GRUCell::pre_validate_and_infer_types() ...@@ -146,9 +146,9 @@ void op::GRUCell::pre_validate_and_infer_types()
const Shape& b_shape{b_pshape.to_shape()}; const Shape& b_shape{b_pshape.to_shape()};
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor B must have shape (",
2 * m_gates_count * get_hidden_size(), 2 * s_gates_count * get_hidden_size(),
"). Actual shape is:", "). Actual shape is:",
b_shape, b_shape,
"."); ".");
...@@ -274,8 +274,8 @@ void op::GRUCell::add_default_bias_input() ...@@ -274,8 +274,8 @@ void op::GRUCell::add_default_bias_input()
{ {
shared_ptr<Node> B = shared_ptr<Node> B =
op::Constant::create(input(0).get_element_type(), op::Constant::create(input(0).get_element_type(),
Shape{2 * m_gates_count * get_hidden_size()}, Shape{2 * s_gates_count * get_hidden_size()},
vector<float>(2 * m_gates_count * get_hidden_size(), 0.f)); vector<float>(2 * s_gates_count * get_hidden_size(), 0.f));
set_argument(4, B->output(0)); set_argument(4, B->output(0));
} }
......
...@@ -144,7 +144,7 @@ namespace ngraph ...@@ -144,7 +144,7 @@ namespace ngraph
/// ///
util::ActivationFunction m_activation_g; 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. /// \brief Control whether or not apply the linear transformation.
/// ///
......
...@@ -121,18 +121,18 @@ void op::LSTMCell::pre_validate_and_infer_types() ...@@ -121,18 +121,18 @@ void op::LSTMCell::pre_validate_and_infer_types()
const Shape& ct_shape{ct_pshape.to_shape()}; const Shape& ct_shape{ct_pshape.to_shape()};
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor W must have shape (",
m_gates_count * get_hidden_size(), s_gates_count * get_hidden_size(),
", ", ", ",
input_size, input_size,
"). Actual shape is:", "). Actual shape is:",
w_shape, w_shape,
"."); ".");
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor R must have shape (",
m_gates_count * get_hidden_size(), s_gates_count * get_hidden_size(),
", ", ", ",
get_hidden_size(), get_hidden_size(),
"). Actual shape is:", "). Actual shape is:",
...@@ -168,7 +168,7 @@ void op::LSTMCell::pre_validate_and_infer_types() ...@@ -168,7 +168,7 @@ void op::LSTMCell::pre_validate_and_infer_types()
const Shape& p_shape{p_pshape.to_shape()}; const Shape& p_shape{p_pshape.to_shape()};
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor B must have shape (",
8 * get_hidden_size(), 8 * get_hidden_size(),
"). Actual shape is:", "). Actual shape is:",
...@@ -176,9 +176,9 @@ void op::LSTMCell::pre_validate_and_infer_types() ...@@ -176,9 +176,9 @@ void op::LSTMCell::pre_validate_and_infer_types()
"."); ".");
NODE_VALIDATION_CHECK(this, 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 (", "Input tensor P must have shape (",
m_peepholes_count * get_hidden_size(), s_peepholes_count * get_hidden_size(),
"). Actual shape is:", "). Actual shape is:",
p_shape, p_shape,
"."); ".");
...@@ -287,15 +287,15 @@ NodeVector op::LSTMCell::get_peephole_weigths() const ...@@ -287,15 +287,15 @@ NodeVector op::LSTMCell::get_peephole_weigths() const
{ {
shared_ptr<Node> P; shared_ptr<Node> P;
P = get_argument(6); 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() void op::LSTMCell::add_default_bias_input()
{ {
shared_ptr<Node> B = shared_ptr<Node> B =
op::Constant::create(input(0).get_element_type(), op::Constant::create(input(0).get_element_type(),
Shape{2 * m_gates_count * get_hidden_size()}, Shape{2 * s_gates_count * get_hidden_size()},
vector<float>(2 * m_gates_count * get_hidden_size(), 0.f)); vector<float>(2 * s_gates_count * get_hidden_size(), 0.f));
set_argument(5, B->output(0)); set_argument(5, B->output(0));
} }
...@@ -303,8 +303,8 @@ void op::LSTMCell::add_default_peepholes_input() ...@@ -303,8 +303,8 @@ void op::LSTMCell::add_default_peepholes_input()
{ {
shared_ptr<Node> P = shared_ptr<Node> P =
op::Constant::create(input(0).get_element_type(), op::Constant::create(input(0).get_element_type(),
Shape{m_peepholes_count * get_hidden_size()}, Shape{s_peepholes_count * get_hidden_size()},
vector<float>(m_peepholes_count * get_hidden_size(), 0.f)); vector<float>(s_peepholes_count * get_hidden_size(), 0.f));
set_argument(6, P->output(0)); set_argument(6, P->output(0));
} }
......
...@@ -168,8 +168,8 @@ namespace ngraph ...@@ -168,8 +168,8 @@ namespace ngraph
/// ///
bool m_input_forget = false; bool m_input_forget = false;
static constexpr std::size_t m_gates_count{4}; static constexpr std::size_t s_gates_count{4};
static constexpr std::size_t m_peepholes_count{3}; static constexpr std::size_t s_peepholes_count{3};
}; };
} }
} }
...@@ -199,8 +199,8 @@ void op::RNNCell::add_default_bias_input() ...@@ -199,8 +199,8 @@ void op::RNNCell::add_default_bias_input()
{ {
shared_ptr<Node> B = shared_ptr<Node> B =
op::Constant::create(input(0).get_element_type(), op::Constant::create(input(0).get_element_type(),
Shape{2 * m_gates_count * get_hidden_size()}, Shape{2 * s_gates_count * get_hidden_size()},
vector<float>(2 * m_gates_count * get_hidden_size(), 0.f)); vector<float>(2 * s_gates_count * get_hidden_size(), 0.f));
set_argument(4, B->output(0)); set_argument(4, B->output(0));
} }
......
...@@ -134,7 +134,7 @@ namespace ngraph ...@@ -134,7 +134,7 @@ namespace ngraph
/// ///
util::ActivationFunction m_activation_f; util::ActivationFunction m_activation_f;
static constexpr std::size_t m_gates_count{1}; static constexpr std::size_t s_gates_count{1};
}; };
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment