Skip to content

Commit

Permalink
[ONNX] Frontend refactoring (openvinotoolkit#22643)
Browse files Browse the repository at this point in the history
### Details:
 - Renamed Node::get_ng_inputs

### Tickets:
 - 125501
  • Loading branch information
gkrivor authored Feb 4, 2024
1 parent c7b4ba3 commit f2a5ad0
Show file tree
Hide file tree
Showing 178 changed files with 271 additions and 275 deletions.
4 changes: 2 additions & 2 deletions src/frontends/onnx/frontend/src/core/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ ov::OutputVector Graph::make_framework_nodes(const Node& onnx_node) {
std::shared_ptr<ov::frontend::onnx::ONNXFrameworkNode> framework_node;
if (onnx_node.has_subgraphs()) {
const auto& subgraphs = onnx_node.get_subgraphs();
auto inputs = onnx_node.get_ng_inputs();
auto inputs = onnx_node.get_ov_inputs();
std::vector<std::shared_ptr<ov::Model>> models;
for (const auto& kv : subgraphs) {
auto& subgraph = kv.second;
Expand Down Expand Up @@ -356,7 +356,7 @@ ov::OutputVector Graph::make_ov_nodes(const Node& onnx_node) {
}
if (ov_subgraph_outputs.empty()) { // translation not possible (not supported op or exception during processing)
const auto not_supported_node =
std::make_shared<ov::frontend::onnx::NotSupportedONNXNode>(onnx_node.get_ng_inputs(),
std::make_shared<ov::frontend::onnx::NotSupportedONNXNode>(onnx_node.get_ov_inputs(),
onnx_node.get_outputs_size(),
onnx_node.domain(),
onnx_node.op_type(),
Expand Down
8 changes: 4 additions & 4 deletions src/frontends/onnx/frontend/src/core/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Node::Impl {
}

const std::vector<Attribute>& attributes() const;
ov::OutputVector get_ng_inputs() const;
ov::OutputVector get_ov_inputs() const;

const std::string& domain() const;
const std::string& op_type() const;
Expand Down Expand Up @@ -200,7 +200,7 @@ ov::Any Node::get_attribute_value(const std::string& name) const {
return get_attribute(name).get_any();
}

ov::OutputVector Node::Impl::get_ng_inputs() const {
ov::OutputVector Node::Impl::get_ov_inputs() const {
ov::OutputVector result;
for (const auto& name : m_node_proto->input()) {
if (!name.empty()) {
Expand Down Expand Up @@ -305,8 +305,8 @@ Node::Node(const Node& other)
delete impl;
}} {}

ov::OutputVector Node::get_ng_inputs() const {
return m_pimpl->get_ng_inputs();
ov::OutputVector Node::get_ov_inputs() const {
return m_pimpl->get_ov_inputs();
}
const std::string& Node::domain() const {
return m_pimpl->domain();
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/core/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Node {
Node& operator=(Node&&) noexcept = delete;
Node& operator=(const Node&) = delete;

ov::OutputVector get_ng_inputs() const;
ov::OutputVector get_ov_inputs() const;
const std::string& domain() const;
const std::string& op_type() const;
const std::string& get_name() const;
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/node_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ov::frontend::onnx::NodeContext::NodeContext(const ov::frontend::onnx::Node& context)
: ov::frontend::NodeContext(context.op_type()),
m_context(context),
m_inputs(context.get_ng_inputs()) {}
m_inputs(context.get_ov_inputs()) {}

ov::Output<ov::Node> ov::frontend::onnx::NodeContext::get_input(int port_idx) const {
return m_inputs.at(port_idx);
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/onnx_framework_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ONNXFrameworkNode : public ov::op::util::FrameworkNode {
public:
OPENVINO_OP("ONNXFrameworkNode", "util", ov::op::util::FrameworkNode);

ONNXFrameworkNode(const ov::frontend::onnx::Node& node) : ONNXFrameworkNode(node, node.get_ng_inputs()) {}
ONNXFrameworkNode(const ov::frontend::onnx::Node& node) : ONNXFrameworkNode(node, node.get_ov_inputs()) {}

ONNXFrameworkNode(const ov::frontend::onnx::Node& node, const ov::OutputVector& inputs)
: ov::op::util::FrameworkNode(inputs, node.get_outputs_size()),
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inline ov::OutputVector abs(const ov::frontend::onnx::Node& node) {
CHECK_VALID_NODE(node,
!node.has_attribute("consumed_inputs"),
"consumed_inputs legacy attribute of Abs op is not supported");
return {std::make_shared<ov::op::v0::Abs>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v0::Abs>(node.get_ov_inputs().at(0))};
}
} // namespace set_1

Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/acos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_7 {
inline ov::OutputVector acos(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v0::Acos>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v0::Acos>(node.get_ov_inputs().at(0))};
}
} // namespace set_7
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/acosh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_9 {
inline ov::OutputVector acosh(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v3::Acosh>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v3::Acosh>(node.get_ov_inputs().at(0))};
}
} // namespace set_9
} // namespace op
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector adaptive_avg_pooling2d(const ov::frontend::onnx::Node& node) {
const auto inputs = node.get_ng_inputs();
const auto inputs = node.get_ov_inputs();
const auto num_inputs = inputs.size();

CHECK_VALID_NODE(node, num_inputs == 2, "adaptive_avg_pooling2d expects 2 input tensors. Got: ", num_inputs);
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ov::OutputVector add(const ov::frontend::onnx::Node& node) {

namespace set_7 {
ov::OutputVector add(const ov::frontend::onnx::Node& node) {
return {std::make_shared<v1::Add>(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))};
return {std::make_shared<v1::Add>(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))};
}
} // namespace set_7
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/affine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ov::OutputVector affine(const ov::frontend::onnx::Node& node) {
// It takes one input tensor and produces one output tensor where
// the affine function, y = alpha * x + beta, is applied to the input
// elementwise.
const auto inputs = node.get_ng_inputs();
const auto inputs = node.get_ov_inputs();

CHECK_VALID_NODE(node, inputs.size() == 1, "Affine expects 1 input tensor. Got: ", inputs.size());
CHECK_VALID_NODE(node, node.has_attribute("alpha"), "\"alpha\" attribute is required.");
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/and.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inline ov::OutputVector logical_and(const ov::frontend::onnx::Node& node) {

namespace set_7 {
inline ov::OutputVector logical_and(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v1::LogicalAnd>(node.get_ng_inputs().at(0), node.get_ng_inputs().at(1))};
return {std::make_shared<ov::op::v1::LogicalAnd>(node.get_ov_inputs().at(0), node.get_ov_inputs().at(1))};
}
} // namespace set_7
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/asin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_1 {
inline ov::OutputVector asin(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v0::Asin>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v0::Asin>(node.get_ov_inputs().at(0))};
}
} // namespace set_1
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/asinh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_1 {
inline ov::OutputVector asinh(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v3::Asinh>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v3::Asinh>(node.get_ov_inputs().at(0))};
}
} // namespace set_1
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/atan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_1 {
inline ov::OutputVector atan(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v0::Atan>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v0::Atan>(node.get_ov_inputs().at(0))};
}
} // namespace set_1
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/atanh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_1 {
inline ov::OutputVector atanh(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v3::Atanh>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v3::Atanh>(node.get_ov_inputs().at(0))};
}
} // namespace set_1
} // namespace op
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/aten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace op {
namespace set_1 {

ov::OutputVector aten(const ov::frontend::onnx::Node& node) {
ov::OutputVector inputs{node.get_ng_inputs()};
ov::OutputVector inputs{node.get_ov_inputs()};

const auto operator_name = node.get_attribute_value<std::string>("operator", "");
CHECK_VALID_NODE(node,
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/onnx/frontend/src/op/batch_norm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace op {
namespace set_1 {
// This version supports ONNX BatchNormalization-1 and BatchNormalization-6
ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) {
ov::OutputVector inputs{node.get_ng_inputs()};
ov::OutputVector inputs{node.get_ov_inputs()};
auto x = inputs.at(0);
auto scale = inputs.at(1);
auto bias = inputs.at(2);
Expand Down Expand Up @@ -56,7 +56,7 @@ ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) {
namespace set_7 {
// This version supports ONNX BatchNormalization-7 and BatchNormalization-9
ov::OutputVector batch_norm(const ov::frontend::onnx::Node& node) {
ov::OutputVector inputs{node.get_ng_inputs()};
ov::OutputVector inputs{node.get_ov_inputs()};
auto x = inputs.at(0);
auto scale = inputs.at(1);
auto bias = inputs.at(2);
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/onnx/frontend/src/op/bitshift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector bitshift(const ov::frontend::onnx::Node& node) {
const ov::Output<ov::Node> input_x = node.get_ng_inputs().at(0);
const ov::Output<ov::Node> input_y = node.get_ng_inputs().at(1);
const ov::Output<ov::Node> input_x = node.get_ov_inputs().at(0);
const ov::Output<ov::Node> input_y = node.get_ov_inputs().at(1);

std::string direction = node.get_attribute_value<std::string>("direction", "");

Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/bitwise_and.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector bitwise_and(const ov::frontend::onnx::Node& node) {
const auto inputs = node.get_ng_inputs();
const auto inputs = node.get_ov_inputs();
OPENVINO_ASSERT(inputs.size() == 2);
return {std::make_shared<v13::BitwiseAnd>(inputs[0], inputs[1])};
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/bitwise_not.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector bitwise_not(const ov::frontend::onnx::Node& node) {
const auto inputs = node.get_ng_inputs();
const auto inputs = node.get_ov_inputs();
OPENVINO_ASSERT(inputs.size() == 1);
return {std::make_shared<v13::BitwiseNot>(inputs[0])};
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/bitwise_or.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector bitwise_or(const ov::frontend::onnx::Node& node) {
const auto inputs = node.get_ng_inputs();
const auto inputs = node.get_ov_inputs();
OPENVINO_ASSERT(inputs.size() == 2);
return {std::make_shared<v13::BitwiseOr>(inputs[0], inputs[1])};
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/bitwise_xor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector bitwise_xor(const ov::frontend::onnx::Node& node) {
const auto inputs = node.get_ng_inputs();
const auto inputs = node.get_ov_inputs();
OPENVINO_ASSERT(inputs.size() == 2);
return {std::make_shared<v13::BitwiseXor>(inputs[0], inputs[1])};
}
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/blackmanwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector blackmanwindow(const ov::frontend::onnx::Node& node) {
const auto size = node.get_ng_inputs().at(0);
const auto size = node.get_ov_inputs().at(0);
const auto output_datatype = common::get_ov_element_type(node.get_attribute_value<int64_t>("output_datatype", 1));
const bool periodic = node.get_attribute_value<int64_t>("periodic", 1) == 1;

Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace op {
namespace set_1 {

ov::OutputVector cast(const ov::frontend::onnx::Node& node) {
auto data = node.get_ng_inputs().at(0);
auto data = node.get_ov_inputs().at(0);
int64_t target_type = node.get_attribute_value<int64_t>("to");
ov::element::Type elem_type = common::get_ov_element_type(target_type);

Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/cast_like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace op {
namespace set_1 {

ov::OutputVector cast_like(const ov::frontend::onnx::Node& node) {
auto inputs = node.get_ng_inputs();
auto inputs = node.get_ov_inputs();
return {std::make_shared<v1::ConvertLike>(inputs.at(0), inputs.at(1))};
}

Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/ceil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace onnx {
namespace op {
namespace set_1 {
inline ov::OutputVector ceil(const ov::frontend::onnx::Node& node) {
return {std::make_shared<ov::op::v0::Ceiling>(node.get_ng_inputs().at(0))};
return {std::make_shared<ov::op::v0::Ceiling>(node.get_ov_inputs().at(0))};
}

} // namespace set_1
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/onnx/frontend/src/op/clip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector clip(const ov::frontend::onnx::Node& node) {
const auto data = node.get_ng_inputs().at(0);
const auto data = node.get_ov_inputs().at(0);

const double max_value = node.get_attribute_value<double>("max", std::numeric_limits<double>::max());

Expand Down Expand Up @@ -72,7 +72,7 @@ std::shared_ptr<ov::op::v0::Constant> get_constant_max_of_type(ov::element::Type
} // namespace

ov::OutputVector clip(const ov::frontend::onnx::Node& node) {
const ov::OutputVector inputs{node.get_ng_inputs()};
const ov::OutputVector inputs{node.get_ov_inputs()};
const ov::Output<ov::Node> data = inputs.at(0);
const ov::element::Type data_type = data.get_element_type();
ov::Output<ov::Node> min;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ std::shared_ptr<ov::Node> get_present_state(const std::shared_ptr<ov::Node>& K,

namespace set_1 {
ov::OutputVector attention(const ov::frontend::onnx::Node& node) {
auto nodes = node.get_ng_inputs();
auto nodes = node.get_ov_inputs();
const auto& input = nodes[0];
const auto& weights = nodes[1];
const auto& bias = nodes[2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector bias_gelu(const ov::frontend::onnx::Node& node) {
auto nodes = node.get_ng_inputs();
auto nodes = node.get_ov_inputs();
FRONT_END_GENERAL_CHECK(nodes.size() == 2, "BiasGelu takes 2 inputs. Provided " + std::to_string(nodes.size()));
return {std::make_shared<v7::Gelu>(std::make_shared<v1::Add>(nodes.at(0), nodes.at(1)))};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector embed_layer_normalization(const ov::frontend::onnx::Node& node) {
auto nodes = node.get_ng_inputs();
auto nodes = node.get_ov_inputs();
auto num_nodes = nodes.size();

FRONT_END_GENERAL_CHECK(num_nodes >= 7 && num_nodes <= 9,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace set_1 {
ov::OutputVector fused_conv(const ov::frontend::onnx::Node& node) {
auto conv_res = conv(node).at(0);

if (node.get_ng_inputs().size() == 4) { // Z input provided
conv_res = std::make_shared<v1::Add>(conv_res, node.get_ng_inputs()[3]);
if (node.get_ov_inputs().size() == 4) { // Z input provided
conv_res = std::make_shared<v1::Add>(conv_res, node.get_ov_inputs()[3]);
}

const auto activation_type = node.get_attribute_value<std::string>("activation");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector fusedgemm(const ov::frontend::onnx::Node& node) {
ov::OutputVector inputs{node.get_ng_inputs()};
ov::OutputVector inputs{node.get_ov_inputs()};
auto num_inputs = inputs.size();
FRONT_END_GENERAL_CHECK(num_inputs == 2 || num_inputs == 3,
"FusedGemm takes 2/3 inputs. Provided " + std::to_string(num_inputs));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector skip_layer_normalization(const ov::frontend::onnx::Node& node) {
auto nodes = node.get_ng_inputs();
auto nodes = node.get_ov_inputs();
auto num_nodes = nodes.size();
FRONT_END_GENERAL_CHECK(num_nodes >= 3 && num_nodes <= 5,
"SkipLayerNormalization takes 3, 4 or 5 inputs. Provided " + std::to_string(num_nodes));
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/onnx/frontend/src/op/compress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector compress(const ov::frontend::onnx::Node& node) {
auto data = node.get_ng_inputs().at(0);
auto condition = node.get_ng_inputs().at(1);
auto data = node.get_ov_inputs().at(0);
auto condition = node.get_ov_inputs().at(1);

int64_t axis = 0;
if (node.has_attribute("axis")) {
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/concat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace onnx {
namespace op {
namespace set_1 {
ov::OutputVector concat(const ov::frontend::onnx::Node& node) {
ov::OutputVector inputs{node.get_ng_inputs()};
ov::OutputVector inputs{node.get_ov_inputs()};
std::int64_t axis = node.get_attribute_value<std::int64_t>("axis");
ov::OutputVector valid_inputs;
std::copy_if(inputs.begin(), inputs.end(), std::back_inserter(valid_inputs), [](ov::Output<ov::Node>& in) -> bool {
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/onnx/frontend/src/op/constant_fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ ov::OutputVector constant_fill(const ov::frontend::onnx::Node& node) {
if (input_as_shape == 1) // use the first input as target shape
{
CHECK_VALID_NODE(node,
node.get_ng_inputs().size() > 0,
node.get_ov_inputs().size() > 0,
"The input which determines output shape was not provided");
target_shape = node.get_ng_inputs().at(0);
target_shape = node.get_ov_inputs().at(0);
if (node.has_attribute("extra_shape")) {
const auto extra_shape_const =
node.get_attribute_as_constant<std::vector<int64_t>>("extra_shape", target_shape.get_element_type());
Expand Down
2 changes: 1 addition & 1 deletion src/frontends/onnx/frontend/src/op/constant_of_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ov::OutputVector constant_of_shape(const ov::frontend::onnx::Node& node) {
} else {
constant_value = v0::Constant::create(ov::element::f32, {}, {0});
}
const auto& inputs = node.get_ng_inputs();
const auto& inputs = node.get_ov_inputs();
if (inputs.size() == 0 || common::is_failsafe_node(inputs[0].get_node_shared_ptr()) ||
ov::op::util::is_null(inputs[0])) {
return {constant_value};
Expand Down
Loading

0 comments on commit f2a5ad0

Please sign in to comment.