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
Merge requests
!8
Quantization ptq
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Quantization ptq
quantization_ptq
into
master
Overview
4
Commits
6
Pipelines
5
Changes
4
Merged
Inna Kucher
requested to merge
quantization_ptq
into
master
1 year ago
Overview
4
Commits
6
Pipelines
5
Changes
4
Expand
Adding implementation of Scaling operator.
0
0
Merge request reports
Compare
master
version 4
9e8c65ed
1 year ago
version 3
a30d47e7
1 year ago
version 2
042f623f
1 year ago
version 1
75473fec
1 year ago
master (base)
and
version 4
latest version
f3261dc5
6 commits,
1 year ago
version 4
9e8c65ed
5 commits,
1 year ago
version 3
a30d47e7
4 commits,
1 year ago
version 2
042f623f
3 commits,
1 year ago
version 1
75473fec
2 commits,
1 year ago
4 files
+
196
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
include/aidge/backend/cpu/operator/ScalingImpl.hpp
0 → 100644
+
66
−
0
Options
/********************************************************************************
* Copyright (c) 2023 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#ifndef __AIDGE_CPU_OPERATOR_ScalingIMPL_H__
#define __AIDGE_CPU_OPERATOR_ScalingIMPL_H__
#include
"aidge/backend/OperatorImpl.hpp"
#include
"aidge/operator/Scaling.hpp"
#include
"aidge/utils/Registrar.hpp"
#include
"aidge/utils/Types.h"
#include
<memory>
#include
<vector>
namespace
Aidge
{
// class Scaling_Op;
// compute kernel registry for forward and backward
class
ScalingImplForward_cpu
:
public
Registrable
<
ScalingImplForward_cpu
,
std
::
tuple
<
DataType
,
DataType
>
,
void
(
const
Scaling_Op
::
Parameters
&
,
std
::
size_t
,
const
void
*
,
void
*
)
>
{
};
class
ScalingImplBackward_cpu
:
public
Registrable
<
ScalingImplBackward_cpu
,
std
::
tuple
<
DataType
,
DataType
>
,
void
(
const
Scaling_Op
::
Parameters
&
,
std
::
size_t
,
const
void
*
,
void
*
)
>
{
};
class
ScalingImpl_cpu
:
public
OperatorImpl
{
private:
const
Scaling_Op
&
mOp
;
std
::
array
<
NbElts_t
,
1
>
mNbConsumedData
;
std
::
array
<
NbElts_t
,
1
>
mNbProducedData
;
public:
ScalingImpl_cpu
(
const
Scaling_Op
&
op
)
:
mOp
(
op
),
mNbConsumedData
({
0
}),
mNbProducedData
({
0
})
{}
static
std
::
unique_ptr
<
ScalingImpl_cpu
>
create
(
const
Scaling_Op
&
op
)
{
//std::cout << "ScalingImpl_cpu create" << std::endl;
return
std
::
make_unique
<
ScalingImpl_cpu
>
(
op
);
}
public
:
NbElts_t
getNbRequiredData
(
const
IOIndex_t
inputIdx
)
const
override
final
;
NbElts_t
getNbRequiredProtected
(
const
IOIndex_t
inputIdx
)
const
override
final
;
NbElts_t
getRequiredMemory
(
const
IOIndex_t
outputIdx
,
const
std
::
vector
<
DimSize_t
>&
inputsSize
)
const
override
final
;
NbElts_t
getNbConsumedData
(
const
IOIndex_t
inputIdx
)
const
override
final
;
NbElts_t
getNbProducedData
(
const
IOIndex_t
outputIdx
)
const
override
final
;
void
updateConsummerProducer
()
override
final
;
void
forward
();
void
backward
();
};
namespace
{
static
Registrar
<
Scaling_Op
>
registrarScalingImpl_cpu
(
"cpu"
,
Aidge
::
ScalingImpl_cpu
::
create
);
}
}
// namespace Aidge
#endif
/* __AIDGE_CPU_OPERATOR_ScalingIMPL_H__ */
\ No newline at end of file
Loading