From 0fe50d79ef2b66eb1dccbb9d45f69cc6b942c363 Mon Sep 17 00:00:00 2001 From: bukejiyu <395822456@qq.com> Date: Fri, 24 Jan 2025 07:16:08 +0000 Subject: [PATCH] windows fix --- src/frontends/paddle/src/op/assign_value.cpp | 5 ++++- src/frontends/paddle/src/op/set_value.cpp | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/frontends/paddle/src/op/assign_value.cpp b/src/frontends/paddle/src/op/assign_value.cpp index 9d6f40d1470abf..a91236f63a7145 100644 --- a/src/frontends/paddle/src/op/assign_value.cpp +++ b/src/frontends/paddle/src/op/assign_value.cpp @@ -20,7 +20,10 @@ NamedOutputs assign_value(const NodeContext& node) { const_node = {opset6::Constant::create(dtype, Shape{shape.begin(), shape.end()}, values)}; } else { auto values = node.get_attribute>("values"); - auto int32_values = std::vector(values.begin(), values.end()); + std::vector int32_values(values.size()); + std::transform(values.begin(), values.end(), int32_values.begin(), [](int64_t v) { + return static_cast(v); + }); const_node = {opset6::Constant::create(dtype, Shape{shape.begin(), shape.end()}, int32_values)}; } break; diff --git a/src/frontends/paddle/src/op/set_value.cpp b/src/frontends/paddle/src/op/set_value.cpp index a7a022c38d2a47..4a9889d940e570 100644 --- a/src/frontends/paddle/src/op/set_value.cpp +++ b/src/frontends/paddle/src/op/set_value.cpp @@ -62,7 +62,10 @@ NamedOutputs set_value(const NodeContext& node) { value_arrt)}; } else { auto value_arrt = node.get_attribute>("values"); - auto int32_value = std::vector(value_arrt.begin(), value_arrt.end()); + std::vector int32_value(value_arrt.size()); + std::transform(value_arrt.begin(), value_arrt.end(), int32_value.begin(), [](int64_t v) { + return static_cast(v); + }); value_node = {default_opset::Constant::create(input_type, Shape{value_shape.begin(), value_shape.end()}, int32_value)};