Commit 10649e87 authored by Adam Rogowiec's avatar Adam Rogowiec Committed by arogowie-intel

Remove unnecesary class member.

parent dfb7095d
...@@ -125,10 +125,11 @@ op::LSTMCell::LSTMCell(const shared_ptr<Node>& X, ...@@ -125,10 +125,11 @@ op::LSTMCell::LSTMCell(const shared_ptr<Node>& X,
Shape{m_gates_count * get_hidden_size()}, Shape{m_gates_count * get_hidden_size()},
vector<float>(m_gates_count * get_hidden_size(), 0.f)); vector<float>(m_gates_count * get_hidden_size(), 0.f));
m_P = ngraph::op::Constant::create(element::f32, const auto& peephole_weights =
Shape{m_peepholes_count * get_hidden_size()}, ngraph::op::Constant::create(element::f32,
vector<float>(m_peepholes_count * get_hidden_size(), 0.f)); Shape{m_peepholes_count * get_hidden_size()},
m_p_iof = builder::split(m_P, m_peepholes_count); vector<float>(m_peepholes_count * get_hidden_size(), 0.f));
m_p_iof = builder::split(peephole_weights, m_peepholes_count);
constructor_validate_and_infer_types(); constructor_validate_and_infer_types();
} }
...@@ -152,7 +153,6 @@ op::LSTMCell::LSTMCell(const shared_ptr<Node>& X, ...@@ -152,7 +153,6 @@ op::LSTMCell::LSTMCell(const shared_ptr<Node>& X,
, m_R{R} , m_R{R}
, m_H_t{H_t} , m_H_t{H_t}
, m_C_t{C_t} , m_C_t{C_t}
, m_P{P}
, m_activation_f{get_activation_function(0)} , m_activation_f{get_activation_function(0)}
, m_activation_g{get_activation_function(1)} , m_activation_g{get_activation_function(1)}
, m_activation_h{get_activation_function(2)} , m_activation_h{get_activation_function(2)}
...@@ -174,15 +174,16 @@ op::LSTMCell::LSTMCell(const shared_ptr<Node>& X, ...@@ -174,15 +174,16 @@ op::LSTMCell::LSTMCell(const shared_ptr<Node>& X,
m_bias = b_W_R.at(0) + b_W_R.at(1); m_bias = b_W_R.at(0) + b_W_R.at(1);
} }
if (!m_P) auto peephole_weights = P;
if (!peephole_weights)
{ {
m_P = peephole_weights =
ngraph::op::Constant::create(element::f32, ngraph::op::Constant::create(element::f32,
Shape{m_peepholes_count * get_hidden_size()}, Shape{m_peepholes_count * get_hidden_size()},
vector<float>(m_peepholes_count * get_hidden_size(), 0.f)); vector<float>(m_peepholes_count * get_hidden_size(), 0.f));
} }
m_p_iof = builder::split(m_P, m_peepholes_count); m_p_iof = builder::split(peephole_weights, m_peepholes_count);
constructor_validate_and_infer_types(); constructor_validate_and_infer_types();
} }
......
...@@ -164,11 +164,6 @@ namespace ngraph ...@@ -164,11 +164,6 @@ namespace ngraph
/// ///
std::shared_ptr<Node> m_C_t; std::shared_ptr<Node> m_C_t;
/// ///
/// \brief The weight tensor for peepholes with shape: [3*hidde_size] - 3 equals to
/// only iof gates.
///
std::shared_ptr<Node> m_P;
///
/// \brief The Activation function f. /// \brief The Activation function f.
/// ///
ActivationFunction m_activation_f; ActivationFunction m_activation_f;
...@@ -190,6 +185,8 @@ namespace ngraph ...@@ -190,6 +185,8 @@ namespace ngraph
/// ///
/// \brief Peephole weights vector for respectively: input, output, and forget gates. /// \brief Peephole weights vector for respectively: input, output, and forget gates.
/// ///
/// Each peephole has shape [hidden_size].
///
NodeVector m_p_iof; NodeVector m_p_iof;
/// ///
/// \brief Sum of biases (weight and recurrence) for input, output, forget, and cell gates. /// \brief Sum of biases (weight and recurrence) for input, output, forget, and cell gates.
......
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