Revise floor (#5618)
* create type_prop tests * add visitors test * fix bug in visitor test * add RTTI macro * fix bug in visitors test * add newline * update spec * update spec * update RTTI definition * move RTTI definitioion to the top of he file * Remove broadcast from attribute tests. * Add Floor-1 to summarize.py report. Co-authored-by: jdanieck <jozef.daniecki@intel.com>
This commit is contained in:
1 parent
19ba314764
commit
4b860890ed
7 files changed
+41
-14
No files matched your search
@@ -16,8 +16,7 @@ namespace ngraph
|
||||
class NGRAPH_API Floor : public util::UnaryElementwiseArithmetic
|
||||
{
|
||||
public:
|
||||
static constexpr NodeTypeInfo type_info{"Floor", 0};
|
||||
const NodeTypeInfo& get_type_info() const override { return type_info; }
|
||||
NGRAPH_RTTI_DECLARATION;
|
||||
/// \brief Constructs a floor operation.
|
||||
Floor() = default;
|
||||
/// \brief Constructs a floor operation.
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
using namespace std;
|
||||
using namespace ngraph;
|
||||
|
||||
constexpr NodeTypeInfo op::Floor::type_info;
|
||||
NGRAPH_RTTI_DEFINITION(op::v0::Floor, "Floor", 0, util::UnaryElementwiseArithmetic);
|
||||
|
||||
op::Floor::Floor(const Output<Node>& arg)
|
||||
: UnaryElementwiseArithmetic(arg)
|
||||
|
||||
@@ -223,6 +223,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/gelu.cpp
|
||||
visitors/op/grn.cpp
|
||||
|
||||
@@ -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);
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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 "util/visitor.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace ngraph;
|
||||
using ngraph::test::NodeBuilder;
|
||||
|
||||
TEST(attributes, floor_op)
|
||||
{
|
||||
NodeBuilder::get_ops().register_factory<opset1::Floor>();
|
||||
const auto A = make_shared<op::Parameter>(element::f32, Shape{5, 2});
|
||||
|
||||
const auto floor = make_shared<opset1::Floor>(A);
|
||||
NodeBuilder builder(floor);
|
||||
|
||||
const auto expected_attr_count = 0;
|
||||
EXPECT_EQ(builder.get_value_map_size(), expected_attr_count);
|
||||
}
|
||||
Reference in new issue
Block a user