Fixed RTTI issues for ngraph::Variant (#1258)
This commit is contained in:
parent
5feeab37d4
commit
1f8a8ab33c
@ -9,6 +9,11 @@
|
||||
|
||||
namespace ngraph {
|
||||
|
||||
template <typename T>
|
||||
VariantImpl<T>::~VariantImpl() { }
|
||||
|
||||
template class INFERENCE_ENGINE_API_CLASS(VariantImpl<InferenceEngine::Parameter>);
|
||||
|
||||
template <>
|
||||
class INFERENCE_ENGINE_API_CLASS(VariantWrapper<InferenceEngine::Parameter>) : public VariantImpl<InferenceEngine::Parameter> {
|
||||
public:
|
||||
|
@ -61,6 +61,8 @@ public:
|
||||
std::vector<std::string> getVectorNames() const;
|
||||
};
|
||||
|
||||
extern template class TRANSFORMATIONS_API VariantImpl<FusedNames>;
|
||||
|
||||
template<>
|
||||
class TRANSFORMATIONS_API VariantWrapper<FusedNames> : public VariantImpl<FusedNames> {
|
||||
public:
|
||||
|
@ -46,6 +46,8 @@ public:
|
||||
std::string getPrimitivesPriority() const;
|
||||
};
|
||||
|
||||
extern template class TRANSFORMATIONS_API VariantImpl<PrimitivesPriority>;
|
||||
|
||||
template<>
|
||||
class TRANSFORMATIONS_API VariantWrapper<PrimitivesPriority> : public VariantImpl<PrimitivesPriority> {
|
||||
public:
|
||||
|
@ -15,6 +15,11 @@
|
||||
|
||||
namespace ngraph {
|
||||
|
||||
template <typename T>
|
||||
VariantImpl<T>::~VariantImpl() { }
|
||||
|
||||
template class ngraph::VariantImpl<FusedNames>;
|
||||
|
||||
constexpr VariantTypeInfo VariantWrapper<FusedNames>::type_info;
|
||||
|
||||
std::string FusedNames::getNames() const {
|
||||
|
@ -18,6 +18,11 @@
|
||||
|
||||
namespace ngraph {
|
||||
|
||||
template <typename T>
|
||||
VariantImpl<T>::~VariantImpl() { }
|
||||
|
||||
template class ngraph::VariantImpl<PrimitivesPriority>;
|
||||
|
||||
constexpr VariantTypeInfo VariantWrapper<PrimitivesPriority>::type_info;
|
||||
|
||||
std::string PrimitivesPriority::getPrimitivesPriority() const {
|
||||
|
@ -21,3 +21,25 @@ using namespace ngraph;
|
||||
// Define variant for std::string
|
||||
constexpr VariantTypeInfo VariantWrapper<std::string>::type_info;
|
||||
constexpr VariantTypeInfo VariantWrapper<int64_t>::type_info;
|
||||
|
||||
Variant::~Variant()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<ngraph::Variant> Variant::init(const std::shared_ptr<ngraph::Node>& node)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<ngraph::Variant> Variant::merge(const ngraph::NodeVector& nodes)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
VariantImpl<T>::~VariantImpl()
|
||||
{
|
||||
}
|
||||
|
||||
template class ngraph::VariantImpl<std::string>;
|
||||
template class ngraph::VariantImpl<int64_t>;
|
||||
|
@ -26,21 +26,14 @@ namespace ngraph
|
||||
{
|
||||
using VariantTypeInfo = DiscreteTypeInfo;
|
||||
|
||||
class Variant
|
||||
class NGRAPH_API Variant
|
||||
{
|
||||
public:
|
||||
virtual ~Variant() {}
|
||||
virtual ~Variant();
|
||||
virtual const VariantTypeInfo& get_type_info() const = 0;
|
||||
|
||||
virtual std::shared_ptr<ngraph::Variant> init(const std::shared_ptr<ngraph::Node>& node)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual std::shared_ptr<ngraph::Variant> merge(const ngraph::NodeVector& nodes)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
virtual std::shared_ptr<ngraph::Variant> init(const std::shared_ptr<ngraph::Node>& node);
|
||||
virtual std::shared_ptr<ngraph::Variant> merge(const ngraph::NodeVector& nodes);
|
||||
};
|
||||
|
||||
template <typename VT>
|
||||
@ -53,6 +46,9 @@ namespace ngraph
|
||||
: m_value(value)
|
||||
{
|
||||
}
|
||||
|
||||
~VariantImpl() override;
|
||||
|
||||
const value_type& get() const { return m_value; }
|
||||
value_type& get() { return m_value; }
|
||||
void set(const value_type& value) { m_value = value; }
|
||||
@ -60,6 +56,9 @@ namespace ngraph
|
||||
value_type m_value;
|
||||
};
|
||||
|
||||
extern template class NGRAPH_API VariantImpl<std::string>;
|
||||
extern template class NGRAPH_API VariantImpl<int64_t>;
|
||||
|
||||
template <typename VT>
|
||||
class VariantWrapper
|
||||
{
|
||||
|
@ -69,6 +69,11 @@ struct Ship
|
||||
|
||||
namespace ngraph
|
||||
{
|
||||
template <typename T>
|
||||
VariantImpl<T>::~VariantImpl()
|
||||
{
|
||||
}
|
||||
|
||||
template <>
|
||||
class VariantWrapper<Ship> : public VariantImpl<Ship>
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user