Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_backend_cpu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Eclipse Projects
aidge
aidge_backend_cpu
Commits
4e04e4ab
Commit
4e04e4ab
authored
11 months ago
by
Maxence Naud
Browse files
Options
Downloads
Patches
Plain Diff
Fix GlobalAvgPooling implementation includes
parent
5f6069c0
No related branches found
No related tags found
2 merge requests
!50
version 0.2.0
,
!42
feat/operator_globalAveragePooling
Pipeline
#42602
canceled
11 months ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/operator/GlobalAveragePoolingImpl.cpp
+16
-12
16 additions, 12 deletions
src/operator/GlobalAveragePoolingImpl.cpp
with
16 additions
and
12 deletions
src/operator/GlobalAveragePoolingImpl.cpp
+
16
−
12
View file @
4e04e4ab
...
...
@@ -9,29 +9,33 @@
*
********************************************************************************/
#include
<cassert>
#include
<chrono>
// std::chrono::milliseconds
#include
<
numeric>
// std::accumulate
#include
<
thread>
// std::this_thread::sleep_for
#include
"aidge/backend/cpu/operator/GlobalAveragePoolingImpl.hpp"
#include
<
functional>
#include
<
memory>
#include
<vector>
#include
"aidge/backend/cpu/operator/GlobalAveragePoolingImpl_forward_kernels.hpp"
#include
"aidge/data/Data.hpp"
#include
"aidge/data/Tensor.hpp"
#include
"aidge/operator/GlobalAveragePooling.hpp"
#include
"aidge/utils/ErrorHandling.hpp"
#include
"aidge/utils/Registrar.hpp"
#include
"aidge/utils/Types.h"
#include
"aidge/backend/cpu/operator/GlobalAveragePoolingImpl.hpp"
#include
"aidge/backend/cpu/operator/GlobalAveragePoolingImpl_forward_kernels.hpp"
void
Aidge
::
GlobalAveragePoolingImpl_cpu
::
forward
()
{
const
GlobalAveragePooling_Op
&
op_
=
static_cast
<
const
GlobalAveragePooling_Op
&>
(
mOp
);
// Check if input is provided
assert
(
std
::
static_pointer_cast
<
Tensor
>
(
mOp
.
get
Raw
Input
(
0
)
)
&&
"missing input"
);
AIDGE_ASSERT
(
op_
.
getInput
(
0
)
,
"missing input
0
"
);
// Create the forward kernal with the wanted types
auto
kernelFunc
=
Registrar
<
GlobalAveragePoolingImplForward_cpu
>::
create
({
std
::
static_pointer_cast
<
Tensor
>
(
mOp
.
get
Raw
Input
(
0
)
)
->
dataType
(),
std
::
static_pointer_cast
<
Tensor
>
(
mOp
.
get
Raw
Output
(
0
)
)
->
dataType
()});
auto
kernelFunc
=
Registrar
<
GlobalAveragePoolingImplForward_cpu
>::
create
({
op_
.
getInput
(
0
)
->
dataType
(),
op_
.
getOutput
(
0
)
->
dataType
()});
// Call kernel
kernelFunc
(
std
::
static_pointer_cast
<
Tensor
>
(
mOp
.
get
Raw
Input
(
0
)
)
->
dims
(),
std
::
static_pointer_cast
<
Tensor
>
(
mOp
.
get
Raw
Input
(
0
)
)
->
getImpl
()
->
rawPtr
(),
std
::
static_pointer_cast
<
Tensor
>
(
mOp
.
get
Raw
Output
(
0
)
)
->
getImpl
()
->
rawPtr
());
kernelFunc
(
op_
.
getInput
(
0
)
->
dims
(),
op_
.
getInput
(
0
)
->
getImpl
()
->
rawPtr
(),
op_
.
getOutput
(
0
)
->
getImpl
()
->
rawPtr
());
}
\ No newline at end of file
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