Skip to content

Conversation

@iarangou
Copy link

This PR adds support for calling core.importModel(tensor) in the JavaScript API.

The new overload allows importing a model directly from a TensorWrap instance.
The change mirrors the recently added C++ overload of ov::Core::import_model(const ov::Tensor&).

Changes included:

  • Added Tensor detection in CoreWrap::import_model
  • Invoked _core.import_model(nativeTensor)
  • Added test test_import_model_tensor.js to validate the new API usage

Issue: #32725

@iarangou iarangou requested a review from a team as a code owner November 19, 2025 03:19
@github-actions github-actions bot added the category: JS API OpenVino JS API Bindings label Nov 19, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Nov 19, 2025
@mlukasze mlukasze requested a review from Copilot November 19, 2025 05:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR extends the JavaScript API to support importing models directly from Tensor instances, mirroring a recently added C++ API overload. The implementation adds tensor detection logic to the existing import_model method and includes test coverage for the new functionality.

Key Changes:

  • Added tensor parameter detection and handling in CoreWrap::import_model
  • Created test case validating the new tensor-based import API

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/bindings/js/node/src/core_wrap.cpp Added tensor overload detection and implementation in import_model method
src/bindings/js/node/tests/test_import_model_tensor.js Added test verifying tensor-based model import functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mlukasze mlukasze linked an issue Nov 19, 2025 that may be closed by this pull request
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 ExternalPR External contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Add import_model(tensor) to JS API

3 participants