Commit 5bfb3cfb authored by Mateusz Bencer's avatar Mateusz Bencer Committed by Scott Cyphers

nom_priors in ProrBoxClustered removed (#3804)

parent ccce8bb1
...@@ -57,19 +57,12 @@ void op::PriorBoxClustered::validate_and_infer_types() ...@@ -57,19 +57,12 @@ void op::PriorBoxClustered::validate_and_infer_types()
image_shape_rank); image_shape_rank);
NODE_VALIDATION_CHECK(this, NODE_VALIDATION_CHECK(this,
m_attrs.widths.size() == m_attrs.num_priors, m_attrs.widths.size() == m_attrs.heights.size(),
"Num_priors ", "Size of heights vector",
m_attrs.num_priors, m_attrs.widths.size(),
" doesn't match size of widths vector ", " doesn't match size of widths vector ",
m_attrs.widths.size()); m_attrs.widths.size());
NODE_VALIDATION_CHECK(this,
m_attrs.heights.size() == m_attrs.num_priors,
"Num_priors ",
m_attrs.num_priors,
" doesn't match size of heights vector ",
m_attrs.heights.size());
set_input_is_relevant_to_shape(0); set_input_is_relevant_to_shape(0);
if (auto const_shape = as_type_ptr<op::Constant>(input_value(0).get_node_shared_ptr())) if (auto const_shape = as_type_ptr<op::Constant>(input_value(0).get_node_shared_ptr()))
...@@ -81,8 +74,9 @@ void op::PriorBoxClustered::validate_and_infer_types() ...@@ -81,8 +74,9 @@ void op::PriorBoxClustered::validate_and_infer_types()
auto layer_shape = const_shape->get_shape_val(); auto layer_shape = const_shape->get_shape_val();
// {Prior boxes, variances-adjusted prior boxes} // {Prior boxes, variances-adjusted prior boxes}
const auto num_priors = m_attrs.widths.size();
set_output_type( set_output_type(
0, element::f32, Shape{2, 4 * layer_shape[0] * layer_shape[1] * m_attrs.num_priors}); 0, element::f32, Shape{2, 4 * layer_shape[0] * layer_shape[1] * num_priors});
} }
else else
{ {
......
...@@ -24,7 +24,6 @@ namespace ngraph ...@@ -24,7 +24,6 @@ namespace ngraph
{ {
struct PriorBoxClusteredAttrs struct PriorBoxClusteredAttrs
{ {
// num_priors Number of prior boxes
// widths Desired widths of prior boxes // widths Desired widths of prior boxes
// heights Desired heights of prior boxes // heights Desired heights of prior boxes
// clip Clip output to [0,1] // clip Clip output to [0,1]
...@@ -32,7 +31,6 @@ namespace ngraph ...@@ -32,7 +31,6 @@ namespace ngraph
// step_heights Distance between prior box centers // step_heights Distance between prior box centers
// offset Box offset relative to top center of image // offset Box offset relative to top center of image
// variances Values to adjust prior boxes with // variances Values to adjust prior boxes with
size_t num_priors;
std::vector<float> widths; std::vector<float> widths;
std::vector<float> heights; std::vector<float> heights;
bool clip = false; bool clip = false;
......
...@@ -113,14 +113,13 @@ TEST(type_prop_layers, prior_box3) ...@@ -113,14 +113,13 @@ TEST(type_prop_layers, prior_box3)
TEST(type_prop_layers, prior_box_clustered) TEST(type_prop_layers, prior_box_clustered)
{ {
op::PriorBoxClusteredAttrs attrs; op::PriorBoxClusteredAttrs attrs;
attrs.num_priors = 3;
attrs.widths = {4.0f, 2.0f, 3.2f}; attrs.widths = {4.0f, 2.0f, 3.2f};
attrs.heights = {1.0f, 2.0f, 1.1f}; attrs.heights = {1.0f, 2.0f, 1.1f};
auto layer_shape = op::Constant::create<int64_t>(element::i64, Shape{2}, {19, 19}); auto layer_shape = op::Constant::create<int64_t>(element::i64, Shape{2}, {19, 19});
auto image_shape = op::Constant::create<int64_t>(element::i64, Shape{2}, {300, 300}); auto image_shape = op::Constant::create<int64_t>(element::i64, Shape{2}, {300, 300});
auto pbc = make_shared<op::PriorBoxClustered>(layer_shape, image_shape, attrs); auto pbc = make_shared<op::PriorBoxClustered>(layer_shape, image_shape, attrs);
// Output shape - 4 * 19 * 19 * 3 (num_priors) // Output shape - 4 * 19 * 19 * 3 (attrs.widths.size())
ASSERT_EQ(pbc->get_shape(), (Shape{2, 4332})); ASSERT_EQ(pbc->get_shape(), (Shape{2, 4332}));
} }
......
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