Skip to content

Commit

Permalink
fix rc
Browse files Browse the repository at this point in the history
Signed-off-by: fishbell <[email protected]>
  • Loading branch information
songbell committed Dec 25, 2023
1 parent bc121c0 commit bc626e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/include/openvino/core/layout.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,16 @@ class OPENVINO_API LayoutAttribute : public ov::RuntimeAttribute {

LayoutAttribute() = default;

explicit LayoutAttribute(const Layout& value) : value(value) {}
explicit LayoutAttribute(const Layout& value) : value(value), m_mutex(std::make_shared<std::mutex>()) {}

bool visit_attributes(AttributeVisitor& visitor) override;

std::string to_string() const override;

Layout value;

private:
std::shared_ptr<std::mutex> m_mutex;
};

} // namespace ov
1 change: 1 addition & 0 deletions src/core/src/layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ void AttributeAdapter<ov::Layout>::set(const std::string& value) {
}

bool LayoutAttribute::visit_attributes(AttributeVisitor& visitor) {
std::lock_guard<std::mutex> lock{*m_mutex.get()};
std::string layout_str = value.to_string();
visitor.on_attribute("layout", layout_str);
value = Layout(layout_str);
Expand Down

0 comments on commit bc626e3

Please sign in to comment.