Skip to content

[OV JS] Expose Model.reshape #30785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

almilosz
Copy link
Contributor

@almilosz almilosz commented May 29, 2025

Details:

  • Add Model.reshape method
  • Add helpers for converting types to js/node/include/helper.hpp and type validation helpers to js/node/include/type_validation.hpp

Tickets:

almilosz added 5 commits May 28, 2025 13:51
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
Signed-off-by: Alicja Miloszewska <[email protected]>
@almilosz almilosz requested a review from Retribution98 May 29, 2025 08:25
@almilosz almilosz requested a review from a team as a code owner May 29, 2025 08:25
@github-actions github-actions bot added the category: JS API OpenVino JS API Bindings label May 29, 2025
Signed-off-by: Alicja Miloszewska <[email protected]>
@@ -62,3 +62,7 @@ Napi::Value PartialShapeWrap::to_string(const Napi::CallbackInfo& info) {
Napi::Value PartialShapeWrap::get_dimensions(const Napi::CallbackInfo& info) {
return cpp_to_js<ov::PartialShape, Napi::Array>(info, _partial_shape);
}

ov::PartialShape PartialShapeWrap::get_value() const {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it required to re turn it by value or can be reference?


std::map<ov::Output<ov::Node>, ov::PartialShape> ModelWrap::get_new_shapes(const Napi::Env& env,
const Napi::Value& value) {
std::map<ov::Output<ov::Node>, ov::PartialShape> new_shapes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
std::map<ov::Output<ov::Node>, ov::PartialShape> new_shapes;
std::unordered_map<ov::Output<ov::Node>, ov::PartialShape> new_shapes;

Can be used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, ov::Output<ov::Node> doesn't have a hash, so it cannot be a key

@almilosz almilosz requested a review from praasz June 2, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: JS API OpenVino JS API Bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants