Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise floor #5618

Merged
merged 14 commits into from
May 21, 2021
1 change: 1 addition & 0 deletions ngraph/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ set(SRC
visitors/op/elu.cpp
visitors/op/extractimagepatches.cpp
visitors/op/fake_quantize.cpp
visitors/op/floor.cpp
visitors/op/gather.cpp
visitors/op/grn.cpp
visitors/op/group_conv.cpp
Expand Down
2 changes: 1 addition & 1 deletion ngraph/test/type_prop/unary_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,6 @@ REGISTER_TYPED_TEST_CASE_P(UnaryOperator,
dynamic_rank_input_shape_3D,
dynamic_rank_input_shape_full);

using Types = ::testing::Types<op::Acos, op::Asin, op::Abs, op::Sqrt, op::Sin, op::Exp>;
using Types = ::testing::Types<op::Acos, op::Asin, op::Abs, op::Sqrt, op::Sin, op::Exp, op::Floor>;

INSTANTIATE_TYPED_TEST_CASE_P(type_prop, UnaryOperator, Types);
31 changes: 31 additions & 0 deletions ngraph/test/visitors/op/floor.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (C) 2018-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include "gtest/gtest.h"

#include "ngraph/ngraph.hpp"
#include "ngraph/op/util/attr_types.hpp"
#include "ngraph/opsets/opset1.hpp"
#include "ngraph/opsets/opset3.hpp"
#include "ngraph/opsets/opset4.hpp"
#include "ngraph/opsets/opset5.hpp"
pszmel marked this conversation as resolved.
Show resolved Hide resolved

#include "util/visitor.hpp"

using namespace std;
using namespace ngraph;
using ngraph::test::NodeBuilder;
using ngraph::test::ValueMap;
pszmel marked this conversation as resolved.
Show resolved Hide resolved

TEST(attributes, floor_op)
{
NodeBuilder::get_ops().register_factory<opset1::Mod>();
pszmel marked this conversation as resolved.
Show resolved Hide resolved
auto A = make_shared<op::Parameter>(element::f32, Shape{5, 2});

auto floor = make_shared<opset1::Floor>(A);
NodeBuilder builder(floor);
auto g_floor = as_type_ptr<opset1::Floor>(builder.create());

EXPECT_EQ(g_floor->get_autob(), floor->get_autob());
jdanieck marked this conversation as resolved.
Show resolved Hide resolved
}