Unverified Commit 0920ed1c authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

address klocwork issue (#1748)

parent 15da6cfe
......@@ -47,14 +47,14 @@ op::Rnn::Rnn(std::shared_ptr<Node> src_layer,
std::shared_ptr<Node> weights_layer,
std::shared_ptr<Node> weights_iter,
std::shared_ptr<Node> bias,
const int num_timesteps,
const int num_gates_per_cell,
const int src_sequence_length,
const int src_layer_feature_size,
const int src_iter_feature_size,
const int num_cell_states,
const int direction,
const int num_fused_layers)
size_t num_timesteps,
size_t num_gates_per_cell,
size_t src_sequence_length,
size_t src_layer_feature_size,
size_t src_iter_feature_size,
size_t num_cell_states,
size_t direction,
size_t num_fused_layers)
: Op("Rnn", check_single_output_args({src_layer, src_iter, weights_layer, weights_iter, bias}))
, m_num_timesteps(num_timesteps)
, m_num_gates_per_cell(num_gates_per_cell)
......@@ -79,7 +79,7 @@ op::Rnn::Rnn(std::shared_ptr<Node> src_layer,
if (src_layer->get_shape().size() == 2)
{
m_batch_size = static_cast<int>(src_layer->get_shape()[0] / num_timesteps);
m_batch_size = src_layer->get_shape()[0] / m_num_timesteps;
}
else
{
......@@ -110,11 +110,9 @@ op::Rnn::Rnn(std::shared_ptr<Node> src_layer,
set_output_size(2);
set_output_type(0,
src_layer->get_element_type(),
Shape{static_cast<unsigned long>(m_direction * m_num_timesteps * m_batch_size),
static_cast<unsigned long>(m_src_iter_feature_size)});
Shape{(m_direction * m_num_timesteps * m_batch_size), m_src_iter_feature_size});
set_output_type(1,
src_layer->get_element_type(),
Shape{static_cast<unsigned long>(m_num_cell_states * m_direction *
m_num_fused_layers * m_batch_size),
static_cast<unsigned long>(m_src_iter_feature_size)});
Shape{(m_num_cell_states * m_direction * m_num_fused_layers * m_batch_size),
m_src_iter_feature_size});
}
......@@ -51,35 +51,35 @@ namespace ngraph
std::shared_ptr<Node> weights_layer,
std::shared_ptr<Node> weights_iter,
std::shared_ptr<Node> bias,
const int num_timesteps,
const int num_gates_per_cell,
const int src_sequence_length,
const int src_layer_feature_size,
const int src_iter_feature_size,
const int num_cell_states,
const int direction,
const int num_fused_layers);
size_t num_timesteps,
size_t num_gates_per_cell,
size_t src_sequence_length,
size_t src_layer_feature_size,
size_t src_iter_feature_size,
size_t num_cell_states,
size_t direction,
size_t num_fused_layers);
virtual std::shared_ptr<Node>
copy_with_new_args(const NodeVector& new_args) const override;
int get_num_timesteps() const { return m_num_timesteps; }
int get_src_sequence_length() const { return m_src_sequence_length; }
int get_gates_per_cell() const { return m_num_gates_per_cell; }
int get_batch_size() const { return m_batch_size; }
int get_src_layer_feature_size() const { return m_src_layer_feature_size; }
int get_src_iter_feature_size() const { return m_src_iter_feature_size; }
int get_num_cell_states() const { return m_num_cell_states; }
int get_direction() const { return m_direction; }
int get_num_fused_layers() const { return m_num_fused_layers; }
size_t get_num_timesteps() const { return m_num_timesteps; }
size_t get_src_sequence_length() const { return m_src_sequence_length; }
size_t get_gates_per_cell() const { return m_num_gates_per_cell; }
size_t get_batch_size() const { return m_batch_size; }
size_t get_src_layer_feature_size() const { return m_src_layer_feature_size; }
size_t get_src_iter_feature_size() const { return m_src_iter_feature_size; }
size_t get_num_cell_states() const { return m_num_cell_states; }
size_t get_direction() const { return m_direction; }
size_t get_num_fused_layers() const { return m_num_fused_layers; }
private:
int m_num_timesteps;
int m_num_gates_per_cell;
int m_src_sequence_length;
int m_batch_size;
int m_src_layer_feature_size;
int m_src_iter_feature_size;
int m_num_cell_states;
int m_direction;
int m_num_fused_layers;
size_t m_num_timesteps;
size_t m_num_gates_per_cell;
size_t m_src_sequence_length;
size_t m_batch_size;
size_t m_src_layer_feature_size;
size_t m_src_iter_feature_size;
size_t m_num_cell_states;
size_t m_direction;
size_t m_num_fused_layers;
};
}
}
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