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
c15bf948
Commit
c15bf948
authored
1 year ago
by
laurent soulier
Browse files
Options
Downloads
Patches
Plain Diff
[MIN][DOX]
parent
216d6948
Branches
feat/TensorCopy
Branches containing commit
No related tags found
1 merge request
!9
Refactoring Tensor
Pipeline
#33044
failed
1 year ago
Stage: static_analysis
Stage: build
Stage: test
Stage: coverage
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/backend/cpu/data/TensorImpl.hpp
+2
-5
2 additions, 5 deletions
include/aidge/backend/cpu/data/TensorImpl.hpp
unit_tests/data/Test_TensorImpl.cpp
+5
-7
5 additions, 7 deletions
unit_tests/data/Test_TensorImpl.cpp
with
7 additions
and
12 deletions
include/aidge/backend/cpu/data/TensorImpl.hpp
+
2
−
5
View file @
c15bf948
...
...
@@ -21,6 +21,7 @@ public:
/// @param i_FirstDataCoordinates Logical coordinates of the data at null natural
/// coordinates
/// @param i_Dimensions Tensor dimensions
/// @sa Coord_t
TensorImpl_cpu
(
DataType
const
i_DataType
,
std
::
vector
<
Coord_t
>
const
&
i_FirstDataCoordinates
,
...
...
@@ -97,11 +98,7 @@ public:
if
(
ptr
)
{
ptr
->
cloneProperties
(
*
this
);
NbElts_t
n
=
std
::
accumulate
(
std
::
begin
(
getDimensions
()),
std
::
end
(
getDimensions
()),
1
,
std
::
multiplies
<
NbElts_t
>
());
NbElts_t
n
=
getNbElts
();
ptr
->
copy
(
getDataAddress
(),
n
);
}
return
detail
::
pimpl
::
ImplPtr_t
(
ptr
);
...
...
This diff is collapsed.
Click to expand it.
unit_tests/data/Test_TensorImpl.cpp
+
5
−
7
View file @
c15bf948
...
...
@@ -24,7 +24,6 @@ template<typename Data_T> bool MakeRainbow(Tensor &i_Tensor)
{
NbElts_t
N
=
i_Tensor
.
size
();
Data_T
*
data
=
reinterpret_cast
<
Data_T
*>
(
i_Tensor
.
getImpl
().
rawPtr
());
Data_T
*
end
=
data
+
N
;
for
(
std
::
size_t
i
=
0
;
i
<
N
;
++
i
,
++
data
)
{
*
data
=
i
;
...
...
@@ -189,12 +188,11 @@ TEST_CASE("Tensor extract")
{
SECTION
(
"shallow extract"
)
{
// Tensor Rainbow;
// Rainbow.resize({2, 4, 5});
// Rainbow.setDatatype(DataType::UInt16);
// Rainbow.setBackend("cpu");
// MakeRainbow<std::uint16_t>(Rainbow);
Tensor
Rainbow
;
Rainbow
.
resize
({
2
,
4
,
5
});
Rainbow
.
setDatatype
(
DataType
::
UInt16
);
Rainbow
.
setBackend
(
"cpu"
);
MakeRainbow
<
std
::
uint16_t
>
(
Rainbow
);
// Tensor view(Rainbow, {2, 2, 3}, {0, 1, 1});
// for (Coord_t a = 0; a < view.dims()[0]; ++a)
// {
...
...
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