SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
OnnxProperty.h
Go to the documentation of this file.
1
17
18#ifndef _SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
19#define _SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
20
22#include <memory>
23#include <NdArray/NdArray.h>
24
25namespace SourceXtractor {
26
30class OnnxProperty : public Property {
31public:
37 virtual ~NdWrapperBase() = default;
38 };
39
43 template<typename T>
44 struct NdWrapper : public NdWrapperBase {
46
47 template <typename ...Args>
48 explicit NdWrapper(Args&&... args) : m_ndarray(std::forward<Args>(args)...) {}
49 };
50
54 virtual ~OnnxProperty() = default;
55
63
70 template<typename T>
72 return dynamic_cast<NdWrapper<T> *>(m_output.at(key).get())->m_ndarray;
73 }
74
75private:
77};
78
79} // end of namespace SourceXtractor
80
81#endif //_SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
virtual ~OnnxProperty()=default
OnnxProperty(std::map< std::string, std::unique_ptr< NdWrapperBase > > &&output)
const Euclid::NdArray::NdArray< T > & getData(const std::string &key) const
std::map< std::string, std::unique_ptr< NdWrapperBase > > m_output
Base class for all Properties. (has no actual content)
Definition Property.h:33
T forward(T... args)
T move(T... args)
STL namespace.
Euclid::NdArray::NdArray< T > m_ndarray