Skip to content

Commit

Permalink
add static_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Asthestarsfalll committed Sep 28, 2023
1 parent a26aa2c commit 743e614
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/frontends/paddle/src/op/partial_concat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ NamedOutputs partial_concat(const NodeContext& node) {
int end_index;
if (length < 0) {
// Negative values for all elements after start_index on second dim.
end_index = x[0].get_shape()[1];
end_index = static_cast<int>(x[0].get_shape()[1]);
} else {
end_index = start_index + length;
}
Expand Down
3 changes: 1 addition & 2 deletions src/frontends/paddle/src/op/partial_sum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ namespace paddle {
namespace op {
NamedOutputs partial_sum(const NodeContext& node) {
auto x = node.get_ng_inputs("X");
// const auto input_dtype = x.get_element_type();
const auto start_index = node.get_attribute<int>("start_index");
const auto length = node.get_attribute<int>("length");
// PADDLE_OP_CHECK(node, x[0].get_shape.size() == 2, "partial op only supports 2-D Tensor");

int end_index;
if (length < 0) {
// Negative values for all elements after start_index on second dim.
end_index = x[0].get_shape()[1];
end_index = static_cast<int>(x[0].get_shape()[1]);
} else {
end_index = start_index + length;
}
Expand Down

0 comments on commit 743e614

Please sign in to comment.