Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cyril Moineau
aidge_core
Commits
af1ba81f
Commit
af1ba81f
authored
11 months ago
by
Grégoire Kubler
Browse files
Options
Downloads
Patches
Plain Diff
feat : add support for py registrar to GlobalAveragePooling_Op
parent
bc065811
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/operator/GlobalAveragePooling.hpp
+7
-5
7 additions, 5 deletions
include/aidge/operator/GlobalAveragePooling.hpp
python_binding/operator/pybind_GlobalAveragePooling.cpp
+3
-2
3 additions, 2 deletions
python_binding/operator/pybind_GlobalAveragePooling.cpp
with
10 additions
and
7 deletions
include/aidge/operator/GlobalAveragePooling.hpp
+
7
−
5
View file @
af1ba81f
...
@@ -34,7 +34,7 @@ namespace Aidge {
...
@@ -34,7 +34,7 @@ namespace Aidge {
class
GlobalAveragePooling_Op
class
GlobalAveragePooling_Op
:
public
OperatorTensor
,
:
public
OperatorTensor
,
public
Registrable
<
GlobalAveragePooling_Op
,
std
::
string
,
public
Registrable
<
GlobalAveragePooling_Op
,
std
::
string
,
std
::
unique
_ptr
<
OperatorImpl
>
(
std
::
shared
_ptr
<
OperatorImpl
>
(
const
GlobalAveragePooling_Op
&
)
>
{
const
GlobalAveragePooling_Op
&
)
>
{
public:
public:
static
const
std
::
string
Type
;
static
const
std
::
string
Type
;
...
@@ -43,9 +43,11 @@ public:
...
@@ -43,9 +43,11 @@ public:
GlobalAveragePooling_Op
(
const
GlobalAveragePooling_Op
&
op
)
GlobalAveragePooling_Op
(
const
GlobalAveragePooling_Op
&
op
)
:
OperatorTensor
(
op
)
{
:
OperatorTensor
(
op
)
{
mImpl
=
op
.
mImpl
?
Registrar
<
GlobalAveragePooling_Op
>::
create
(
if
(
op
.
mImpl
){
op
.
mOutputs
[
0
]
->
getImpl
()
->
backend
())(
*
this
)
SET_IMPL_MACRO
(
GlobalAveragePooling_Op
,
*
this
,
op
.
mOutputs
[
0
]
->
getImpl
()
->
backend
());
:
nullptr
;
}
else
{
mImpl
=
nullptr
;
}
}
}
std
::
shared_ptr
<
Operator
>
clone
()
const
override
{
std
::
shared_ptr
<
Operator
>
clone
()
const
override
{
...
@@ -55,7 +57,7 @@ public:
...
@@ -55,7 +57,7 @@ public:
void
computeOutputDims
()
override
final
;
void
computeOutputDims
()
override
final
;
void
setBackend
(
const
std
::
string
&
name
,
DeviceIdx_t
device
=
0
)
override
{
void
setBackend
(
const
std
::
string
&
name
,
DeviceIdx_t
device
=
0
)
override
{
mImpl
=
Registrar
<
GlobalAveragePooling_Op
>::
create
(
name
)(
*
this
);
mImpl
=
SET_IMPL_MACRO
(
GlobalAveragePooling_Op
,
*
this
,
name
);
mOutputs
[
0
]
->
setBackend
(
name
,
device
);
mOutputs
[
0
]
->
setBackend
(
name
,
device
);
}
}
...
...
This diff is collapsed.
Click to expand it.
python_binding/operator/pybind_GlobalAveragePooling.cpp
+
3
−
2
View file @
af1ba81f
...
@@ -18,13 +18,14 @@
...
@@ -18,13 +18,14 @@
namespace
py
=
pybind11
;
namespace
py
=
pybind11
;
namespace
Aidge
{
namespace
Aidge
{
const
std
::
string
pyClassName
(
"GlobalAveragePoolingOp"
);
void
init_GlobalAveragePooling
(
py
::
module
&
m
)
{
void
init_GlobalAveragePooling
(
py
::
module
&
m
)
{
py
::
class_
<
GlobalAveragePooling_Op
,
std
::
shared_ptr
<
GlobalAveragePooling_Op
>
,
py
::
class_
<
GlobalAveragePooling_Op
,
std
::
shared_ptr
<
GlobalAveragePooling_Op
>
,
OperatorTensor
>
(
m
,
"GlobalAveragePooling"
,
OperatorTensor
>
(
m
,
pyClassName
.
c_str
,
py
::
multiple_inheritance
())
py
::
multiple_inheritance
())
.
def
(
"get_inputs_name"
,
&
GlobalAveragePooling_Op
::
getInputsName
)
.
def
(
"get_inputs_name"
,
&
GlobalAveragePooling_Op
::
getInputsName
)
.
def
(
"get_outputs_name"
,
&
GlobalAveragePooling_Op
::
getOutputsName
);
.
def
(
"get_outputs_name"
,
&
GlobalAveragePooling_Op
::
getOutputsName
);
declare_registrable
<
GlobalAveragePooling_Op
>
(
m
,
pyClassName
);
m
.
def
(
"globalaveragepooling"
,
&
GlobalAveragePooling
,
py
::
arg
(
"name"
)
=
""
);
m
.
def
(
"globalaveragepooling"
,
&
GlobalAveragePooling
,
py
::
arg
(
"name"
)
=
""
);
}
}
}
// namespace Aidge
}
// namespace Aidge
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment