SourceXtractorPlusPlus  0.13
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OnnxProperty.h
Go to the documentation of this file.
1 
18 #ifndef _SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
19 #define _SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
20 
22 #include <memory>
23 #include <NdArray/NdArray.h>
24 
25 namespace SourceXtractor {
26 
30 class OnnxProperty : public Property {
31 public:
36  struct NdWrapperBase {
37  virtual ~NdWrapperBase() = default;
38  };
39 
43  template<typename T>
44  struct NdWrapper : public NdWrapperBase {
46 
47  template <typename ...Args>
48  NdWrapper(Args&&... args) : m_ndarray(std::forward<Args>(args)...) {}
49  };
50 
54  virtual ~OnnxProperty() = default;
55 
63 
70  template<typename T>
71  const Euclid::NdArray::NdArray<T>& getData(const std::string& key) const {
72  return dynamic_cast<NdWrapper<T> *>(m_output.at(key).get())->m_ndarray;
73  }
74 
75 private:
77 };
78 
79 } // end of namespace SourceXtractor
80 
81 #endif //_SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
const Euclid::NdArray::NdArray< T > & getData(const std::string &key) const
Definition: OnnxProperty.h:71
STL class.
Base class for all Properties. (has no actual content)
Definition: Property.h:33
STL class.
T move(T...args)
STL class.
virtual ~OnnxProperty()=default
OnnxProperty(std::map< std::string, std::unique_ptr< NdWrapperBase >> &&output)
Definition: OnnxProperty.h:62
std::map< std::string, std::unique_ptr< NdWrapperBase > > m_output
Definition: OnnxProperty.h:76
T forward(T...args)
Euclid::NdArray::NdArray< T > m_ndarray
Definition: OnnxProperty.h:45