-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PDPD] support expand_as_v2 and less_equal (#28264)
### Details: - enable [expand_as_v2](https://www.paddlepaddle.org.cn/documentation/docs/en/api/paddle/expand_as_en.html#expand-as) op - enable [less_equal](https://www.paddlepaddle.org.cn/documentation/docs/en/api/paddle/less_equal_en.html#less-equal) op ### Tickets: - *N/A* --------- Co-authored-by: Yu Xu <[email protected]>
- Loading branch information
Showing
7 changed files
with
121 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2018-2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "default_opset.hpp" | ||
#include "openvino/frontend/paddle/node_context.hpp" | ||
|
||
namespace ov { | ||
namespace frontend { | ||
namespace paddle { | ||
namespace op { | ||
NamedOutputs expand_as_v2(const NodeContext& node) { | ||
using namespace default_opset; | ||
auto x = node.get_input("X"); | ||
Output<Node> shape_expected_node; | ||
if (node.has_input("Y")) { | ||
shape_expected_node = std::make_shared<ShapeOf>(node.get_input("Y"), element::i32); | ||
} else { | ||
std::vector<int32_t> shape_expected; | ||
if (node.has_attribute("target_shape")) { | ||
shape_expected = node.get_attribute<std::vector<int32_t>>("target_shape"); | ||
} else { | ||
throw std::runtime_error("expand: has no target_shape attribute"); | ||
} | ||
shape_expected_node = Constant::create(element::i32, {shape_expected.size()}, shape_expected); | ||
} | ||
return node.default_single_output_mapping({std::make_shared<Broadcast>(x, shape_expected_node)}, {"Out"}); | ||
} | ||
|
||
} // namespace op | ||
} // namespace paddle | ||
} // namespace frontend | ||
} // namespace ov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters