Fix warnings for Paddle Frontend (#19476)

* Fixed warnings for Paddle Frontend

* fix CI linux-gnu-9 build fail issue
This commit is contained in:
Bo Liu 2023-08-30 16:08:08 +08:00 committed by GitHub
parent 9b10ef6f6f
commit 6b57360c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 10 deletions

View File

@ -55,6 +55,9 @@ public:
/// \brief Get the type of the operation
virtual std::string get_op_type() const = 0;
/// \brief Destructor
virtual ~DecoderBase();
};
} // namespace paddle
} // namespace frontend

View File

@ -2,12 +2,6 @@
# SPDX-License-Identifier: Apache-2.0
#
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
ie_add_compiler_flags(/wd4305)
elseif(OV_COMPILER_IS_CLANG)
ie_add_compiler_flags(-Wno-delete-non-abstract-non-virtual-dtor)
endif()
ov_add_frontend(NAME paddle
LINKABLE_FRONTEND
PROTOBUF_LITE

View File

@ -0,0 +1,9 @@
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#include "openvino/frontend/paddle/decoder.hpp"
using namespace ov::frontend::paddle;
DecoderBase::~DecoderBase() = default;

View File

@ -23,12 +23,12 @@ NamedOutputs generate_proposals_v2(const NodeContext& node) {
// attribute
ov::op::v9::GenerateProposals::Attributes attrs;
float min_size = node.get_attribute<float>("min_size", 0.1);
float min_size = node.get_attribute<float>("min_size", 0.1f);
attrs.min_size = min_size < 1.0f ? 1.0f : min_size;
attrs.nms_threshold = node.get_attribute<float>("nms_thresh", 0.5);
attrs.nms_threshold = node.get_attribute<float>("nms_thresh", 0.5f);
attrs.pre_nms_count = node.get_attribute<int>("pre_nms_topN", 6000);
attrs.post_nms_count = node.get_attribute<int>("post_nms_topN", 1000);
attrs.nms_eta = node.get_attribute<float>("eta", 1.0);
attrs.nms_eta = node.get_attribute<float>("eta", 1.0f);
PADDLE_OP_CHECK(node, (attrs.nms_eta == 1.0), "Only support case of eta == 1.0 currently");
attrs.normalized = !node.get_attribute<bool>("pixel_offset", true);

View File

@ -25,7 +25,7 @@ Output<ov::Node> reshape_channel_shaped_node_to_nchw(const Output<ov::Node>& nod
NamedOutputs group_norm(const NodeContext& node) {
auto data = node.get_input("X");
size_t num_groups = static_cast<size_t>(node.get_attribute<int32_t>("groups"));
auto epsilon = node.get_attribute<float>("epsilon", 1e-5);
auto epsilon = node.get_attribute<float>("epsilon", 1e-5f);
auto data_layout = node.get_attribute<std::string>("data_layout", "NCHW");
const auto& pshape = data.get_partial_shape();