Skip to content

Commit

Permalink
Squeeze with scalar axis (#5811)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgenya Stepyreva authored May 25, 2021
1 parent 4db8285 commit 94f814b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ngraph/test/type_prop/squeeze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,22 @@ TEST(type_prop, squeeze_incorrect_negative_axes)
{
FAIL() << "Deduced type check failed for unexpected reason";
}
}
}

TEST(type_prop, squeeze_scalar_axes)
{
auto param = make_shared<op::Parameter>(element::f32, Shape{1, 4, 1, 4, 1, 8});
auto axes_node =
make_shared<ngraph::op::Constant>(element::i64, Shape{}, vector<int64_t>{2});
auto squeeze = make_shared<op::Squeeze>(param, axes_node);

ASSERT_EQ(squeeze->get_element_type(), element::f32);
ASSERT_EQ(squeeze->get_shape(), (Shape{1, 4, 4, 1, 8}));

int squeeze_index = 0;
axes_node = make_shared<ngraph::op::Constant>(element::i64, Shape{}, squeeze_index);
squeeze = make_shared<op::Squeeze>(param, axes_node);

ASSERT_EQ(squeeze->get_element_type(), element::f32);
ASSERT_EQ(squeeze->get_shape(), (Shape{4, 1, 4, 1, 8}));
}

0 comments on commit 94f814b

Please sign in to comment.