SourceXtractorPlusPlus
0.12
Please provide a description of the project.
SEImplementation
SEImplementation
Plugin
Onnx
OnnxProperty.h
Go to the documentation of this file.
1
18
#ifndef _SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
19
#define _SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
20
21
#include "
SEFramework/Property/Property.h
"
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
{
45
Euclid::NdArray::NdArray<T>
m_ndarray
;
46
47
template
<
typename
...Args>
48
NdWrapper
(Args&&... args) :
m_ndarray
(
std
::
forward
<Args>(args)...) {}
49
};
50
54
virtual
~OnnxProperty
() =
default
;
55
62
OnnxProperty
(
std::map
<
std::string
,
std::unique_ptr<NdWrapperBase>
>&& output) :
m_output
(
std
::
move
(output)) {}
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
:
76
std::map<std::string, std::unique_ptr<NdWrapperBase>
>
m_output
;
77
};
78
79
}
// end of namespace SourceXtractor
80
81
#endif //_SEIMPLEMENTATION_PLUGIN_ONNXATTRIBUTE_H_
Property.h
NdArray.h
std
STL namespace.
Euclid::NdArray::NdArray
SourceXtractor::OnnxProperty::getData
const Euclid::NdArray::NdArray< T > & getData(const std::string &key) const
Definition:
OnnxProperty.h:71
SourceXtractor::OnnxProperty::NdWrapper::NdWrapper
NdWrapper(Args &&... args)
Definition:
OnnxProperty.h:48
SourceXtractor::OnnxProperty
Definition:
OnnxProperty.h:30
std::map
STL class.
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition:
Property.h:33
std::string
STL class.
SourceXtractor
Definition:
Aperture.h:30
std::move
T move(T... args)
std::unique_ptr
STL class.
SourceXtractor::OnnxProperty::NdWrapperBase::~NdWrapperBase
virtual ~NdWrapperBase()=default
SourceXtractor::OnnxProperty::~OnnxProperty
virtual ~OnnxProperty()=default
SourceXtractor::OnnxProperty::OnnxProperty
OnnxProperty(std::map< std::string, std::unique_ptr< NdWrapperBase >> &&output)
Definition:
OnnxProperty.h:62
SourceXtractor::OnnxProperty::m_output
std::map< std::string, std::unique_ptr< NdWrapperBase > > m_output
Definition:
OnnxProperty.h:76
SourceXtractor::OnnxProperty::NdWrapperBase
Definition:
OnnxProperty.h:36
std::forward
T forward(T... args)
SourceXtractor::OnnxProperty::NdWrapper::m_ndarray
Euclid::NdArray::NdArray< T > m_ndarray
Definition:
OnnxProperty.h:45
SourceXtractor::OnnxProperty::NdWrapper
Definition:
OnnxProperty.h:44
Generated by
1.8.14