SourceXtractorPlusPlus
0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
explicit
NdWrapper
(
Args
&&...
args
) :
m_ndarray
(
std
::
forward
<
Args
>(
args
)...) {}
49
};
50
54
virtual
~OnnxProperty
() =
default
;
55
62
explicit
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
std::string
Euclid::NdArray::NdArray
SourceXtractor::OnnxProperty
Definition
OnnxProperty.h:30
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::getData
const Euclid::NdArray::NdArray< T > & getData(const std::string &key) const
Definition
OnnxProperty.h:71
SourceXtractor::OnnxProperty::m_output
std::map< std::string, std::unique_ptr< NdWrapperBase > > m_output
Definition
OnnxProperty.h:76
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition
Property.h:33
std::forward
T forward(T... args)
std::function
std::map
std::move
T move(T... args)
SourceXtractor
Definition
Aperture.h:30
std
STL namespace.
SourceXtractor::OnnxProperty::NdWrapperBase
Definition
OnnxProperty.h:36
SourceXtractor::OnnxProperty::NdWrapperBase::~NdWrapperBase
virtual ~NdWrapperBase()=default
SourceXtractor::OnnxProperty::NdWrapper
Definition
OnnxProperty.h:44
SourceXtractor::OnnxProperty::NdWrapper::m_ndarray
Euclid::NdArray::NdArray< T > m_ndarray
Definition
OnnxProperty.h:45
SourceXtractor::OnnxProperty::NdWrapper::NdWrapper
NdWrapper(Args &&... args)
Definition
OnnxProperty.h:48
Generated by
1.10.0