diff --git a/ggml/src/ggml-openvino/ggml-decoder.cpp b/ggml/src/ggml-openvino/ggml-decoder.cpp index 76553c1b97..5f49a11e27 100644 --- a/ggml/src/ggml-openvino/ggml-decoder.cpp +++ b/ggml/src/ggml-openvino/ggml-decoder.cpp @@ -779,8 +779,8 @@ ov::PartialShape GgmlOvDecoder::get_output_shape(int node_idx) const { return ov::PartialShape(get_shape(ggml_tensor)); } -ov::element::Type GgmlOvDecoder::get_output_type(const std::string & name) const { - return get_ov_type(m_outputs.at(name)); +ov::element::Type GgmlOvDecoder::get_output_type(const int node_idx) const { + return get_ov_type(m_node_info_list[node_idx].node); } std::vector GgmlOvDecoder::get_output_names(int node_idx) const { diff --git a/ggml/src/ggml-openvino/ggml-decoder.h b/ggml/src/ggml-openvino/ggml-decoder.h index 9b0d02c3eb..25ea9af7f3 100644 --- a/ggml/src/ggml-openvino/ggml-decoder.h +++ b/ggml/src/ggml-openvino/ggml-decoder.h @@ -107,7 +107,7 @@ public: virtual ov::PartialShape get_output_shape(int node_idx) const override; - virtual ov::element::Type get_output_type(const std::string & name) const override; + virtual ov::element::Type get_output_type(const int node_idx) const override; virtual int32_t * get_input_op_params(const std::string & name) const override; diff --git a/ggml/src/ggml-openvino/openvino/decoder.hpp b/ggml/src/ggml-openvino/openvino/decoder.hpp index a2ab8df691..da57785214 100644 --- a/ggml/src/ggml-openvino/openvino/decoder.hpp +++ b/ggml/src/ggml-openvino/openvino/decoder.hpp @@ -39,7 +39,7 @@ public: virtual PartialShape get_output_shape(int node_idx) const = 0; - virtual element::Type get_output_type(const std::string& name) const = 0; + virtual element::Type get_output_type(const int node_idx) const = 0; virtual int32_t* get_input_op_params(const std::string& name) const = 0; diff --git a/ggml/src/ggml-openvino/openvino/node_context.hpp b/ggml/src/ggml-openvino/openvino/node_context.hpp index 42d950c3eb..3ca244b720 100644 --- a/ggml/src/ggml-openvino/openvino/node_context.hpp +++ b/ggml/src/ggml-openvino/openvino/node_context.hpp @@ -61,8 +61,8 @@ public: int32_t * get_output_op_params() const { return m_decoder->get_output_op_params(m_node_idx); } - ov::element::Type get_output_type(size_t index) const { - return m_decoder->get_output_type(m_output_names[index]); + ov::element::Type get_output_type() const { + return m_decoder->get_output_type(m_node_idx); } Output get_input(int idx) const override { diff --git a/ggml/src/ggml-openvino/openvino/op/cpy.cpp b/ggml/src/ggml-openvino/openvino/op/cpy.cpp index d5186cddee..ded2f0ca78 100644 --- a/ggml/src/ggml-openvino/openvino/op/cpy.cpp +++ b/ggml/src/ggml-openvino/openvino/op/cpy.cpp @@ -11,7 +11,7 @@ namespace ggml { namespace op { OutputVector translate_cpy(const NodeContext & context) { - auto res = std::make_shared(context.get_input(0), context.get_output_type(0)); + auto res = std::make_shared(context.get_input(0), context.get_output_type()); return rename_outputs_with_suffix({res}, context.get_name()); } diff --git a/ggml/src/ggml-openvino/openvino/op/get_rows.cpp b/ggml/src/ggml-openvino/openvino/op/get_rows.cpp index ace79c33a9..dc8454a199 100644 --- a/ggml/src/ggml-openvino/openvino/op/get_rows.cpp +++ b/ggml/src/ggml-openvino/openvino/op/get_rows.cpp @@ -42,8 +42,8 @@ OutputVector translate_get_rows(const NodeContext & context) { res = std::make_shared(data, indices, axis); } - if (res.get_element_type() != context.get_output_type(0)) { - res = std::make_shared(res, context.get_output_type(0)); + if (res.get_element_type() != context.get_output_type()) { + res = std::make_shared(res, context.get_output_type()); } res = std::make_shared(res, ov::op::v0::Constant::create(ov::element::i64, {1}, {0})); return rename_outputs_with_suffix({res}, context.get_name()); diff --git a/ggml/src/ggml-openvino/openvino/op/set_rows.cpp b/ggml/src/ggml-openvino/openvino/op/set_rows.cpp index eb128f04a3..4ceb55589e 100644 --- a/ggml/src/ggml-openvino/openvino/op/set_rows.cpp +++ b/ggml/src/ggml-openvino/openvino/op/set_rows.cpp @@ -32,7 +32,7 @@ OutputVector translate_set_rows(const NodeContext & context) { auto indices = context.get_input(1); auto dst = context.get_input(2); - data = std::make_shared(data, context.get_output_type(0)); + data = std::make_shared(data, context.get_output_type()); auto dst_shape = context.get_output_shape().to_shape(); diff --git a/ggml/src/ggml-openvino/openvino/op/softmax.cpp b/ggml/src/ggml-openvino/openvino/op/softmax.cpp index 921475e51a..782fdf078d 100644 --- a/ggml/src/ggml-openvino/openvino/op/softmax.cpp +++ b/ggml/src/ggml-openvino/openvino/op/softmax.cpp @@ -63,8 +63,8 @@ OutputVector translate_soft_max(const NodeContext & context) { mask_node_sliced = std::make_shared(mask_node, zero, token_len, one, one); } - if (mask_node_sliced.get_element_type() != context.get_output_type(0)) { - mask_node_sliced = std::make_shared(mask_node_sliced, context.get_output_type(0)); + if (mask_node_sliced.get_element_type() != context.get_output_type()) { + mask_node_sliced = std::make_shared(mask_node_sliced, context.get_output_type()); } Output slope_mask;