-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use OV RTTI for ConversionExtensions #28834
Use OV RTTI for ConversionExtensions #28834
Conversation
} | ||
virtual const DiscreteTypeInfo& get_type_info() const { | ||
return get_type_info_static(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@t-jankowski I see that in some places we need to use custom RTTI declaration to ensure it's marked as virtual
Can we expend OPENVINO_RTTI
for such cases ? I suppose default OPENVINO_RTTI
does not provide virtual? should we have something like OPENVINO_RTTI_BASE_CLASS
or similar ? to denote that we later want to override definitions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, OPENVINO_RTTI_BASE_CLASS
would enforce virtual for get_type_info
. I'll make it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #28911
c579de4
to
fe9bdc9
Compare
fe9bdc9
to
a003084
Compare
src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment left
...frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/extension/conversion.hpp
Show resolved
Hide resolved
2a80515
to
d8cd8b9
Compare
src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp
Outdated
Show resolved
Hide resolved
...frontends/tensorflow_lite/include/openvino/frontend/tensorflow_lite/extension/conversion.hpp
Outdated
Show resolved
Hide resolved
d8cd8b9
to
30a1082
Compare
30a1082
to
96235f9
Compare
src/frontends/tensorflow/include/openvino/frontend/tensorflow/extension/conversion.hpp
Outdated
Show resolved
Hide resolved
@olpipi @rkazants @t-jankowski @praasz please, review |
# define OPENVINO_DYNAMIC_CAST | ||
return true; | ||
#else | ||
return std::is_base_of_v<ov::frontend::ConversionExtensionBase, T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it a bit odd that we have common code that depends on some specific details. (as_type_ptr depends on ov::frontend::ConversionExtensionBase).
I'd suggest to add special conversion func for ConversionExtensions into src/frontends/common/include/openvino/frontend/extension/conversion.hpp
. And use it from FEs instead of as_type_ptr.
Smth like that:
template <typename Type, typename Value, typename = std::enable_if_t<std::is_base_of_v<ConversionExtensionBase, Type>>>
auto conversion_extension_as_type_ptr(const Value& value) -> decltype(::ov::util::AsTypePtr<Value>::template call<Type>(value)) {
return ::ov::util::AsTypePtr<Value>::template call<Type>(value);
}
But if everyone else is ok with it, then OK :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the conclusion. As of solution I'd apply some type traits based on integral_const.
Details:
Tickets: