Skip to content

Conversation

@t-jankowski
Copy link
Contributor

Details:

  • Map key type changed to weak pointer to avoid raw pointers accidental match on reused memory space.

Tickets:

Signed-off-by: Tomasz Jankowski <[email protected]>
@t-jankowski t-jankowski requested a review from a team as a code owner November 3, 2025 15:30
@github-actions github-actions bot added the category: Core OpenVINO Core (aka ngraph) label Nov 3, 2025
@praasz praasz added this to the 2026.0 milestone Nov 5, 2025
Comment on lines +65 to +78
struct WeakNodeHash {
size_t operator()(const std::weak_ptr<ov::Node>& wn) const {
const auto sn = wn.lock();
return sn ? std::hash<ov::Node*>()(sn.get()) : 0;
}
};

struct WeakNodeEqual {
bool operator()(const std::weak_ptr<ov::Node>& lhs, const std::weak_ptr<ov::Node>& rhs) const {
return !lhs.owner_before(rhs) && !rhs.owner_before(lhs);
}
};

std::unordered_map<std::weak_ptr<ov::Node>, ov::RTMap, WeakNodeHash, WeakNodeEqual> m_rt_info_cache;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@praasz, the hashing operator has changed as previous one was unstable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: Core OpenVINO Core (aka ngraph)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants