Skip to content

Commit

Permalink
windows fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bukejiyu committed Jan 24, 2025
1 parent 2f488af commit 0fe50d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/frontends/paddle/src/op/assign_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::vector<int64_t>>("values");
auto int32_values = std::vector<int32_t>(values.begin(), values.end());
std::vector<int32_t> int32_values(values.size());
std::transform(values.begin(), values.end(), int32_values.begin(), [](int64_t v) {
return static_cast<int32_t>(v);
});
const_node = {opset6::Constant::create(dtype, Shape{shape.begin(), shape.end()}, int32_values)};
}
break;
Expand Down
5 changes: 4 additions & 1 deletion src/frontends/paddle/src/op/set_value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ NamedOutputs set_value(const NodeContext& node) {
value_arrt)};
} else {
auto value_arrt = node.get_attribute<std::vector<int64_t>>("values");
auto int32_value = std::vector<int32_t>(value_arrt.begin(), value_arrt.end());
std::vector<int32_t> int32_value(value_arrt.size());
std::transform(value_arrt.begin(), value_arrt.end(), int32_value.begin(), [](int64_t v) {
return static_cast<int32_t>(v);
});
value_node = {default_opset::Constant::create(input_type,
Shape{value_shape.begin(), value_shape.end()},
int32_value)};
Expand Down

0 comments on commit 0fe50d7

Please sign in to comment.