Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eigenpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
eigenpy
Commits
d833b7bd
Verified
Commit
d833b7bd
authored
2 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: remove TensorBase
parent
2215ca51
No related branches found
No related tags found
No related merge requests found
Pipeline
#25968
failed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/eigenpy/eigen-allocator.hpp
+2
-5
2 additions, 5 deletions
include/eigenpy/eigen-allocator.hpp
include/eigenpy/numpy-allocator.hpp
+4
-11
4 additions, 11 deletions
include/eigenpy/numpy-allocator.hpp
with
6 additions
and
16 deletions
include/eigenpy/eigen-allocator.hpp
+
2
−
5
View file @
d833b7bd
...
...
@@ -342,11 +342,8 @@ struct eigen_allocator_impl_tensor {
tensor)
/// \brief Copy Python array into the input matrix mat.
template
<
typename
TensorDerived
,
int
AccessLevel
>
static
void
copy
(
const
Eigen
::
TensorBase
<
TensorDerived
,
AccessLevel
>
&
tensor_
)
{
TensorDerived
&
tensor
=
const_cast
<
TensorDerived
&>
(
static_cast
<
const
TensorDerived
&>
(
tensor_
));
template
<
typename
TensorDerived
>
static
void
copy
(
PyArrayObject
*
pyArray
,
TensorDerived
&
tensor
)
{
const
int
pyArray_type_code
=
EIGENPY_GET_PY_ARRAY_TYPE
(
pyArray
);
const
int
Scalar_type_code
=
Register
::
getTypeCode
<
Scalar
>
();
...
...
This diff is collapsed.
Click to expand it.
include/eigenpy/numpy-allocator.hpp
+
4
−
11
View file @
d833b7bd
...
...
@@ -78,8 +78,8 @@ struct numpy_allocator_impl<const TensorType,
template
<
typename
TensorType
>
struct
numpy_allocator_impl_tensor
{
template
<
typename
TensorDerived
>
static
PyArrayObject
*
allocate
(
const
Eigen
::
TensorBase
<
TensorDerived
>
&
tensor
,
npy_intp
nd
,
npy_intp
*
shape
)
{
static
PyArrayObject
*
allocate
(
const
TensorDerived
&
tensor
,
npy_intp
nd
,
npy_intp
*
shape
)
{
const
int
code
=
Register
::
getTypeCode
<
typename
TensorDerived
::
Scalar
>
();
PyArrayObject
*
pyArray
=
(
PyArrayObject
*
)
call_PyArray_SimpleNew
(
static_cast
<
int
>
(
nd
),
shape
,
code
);
...
...
@@ -250,10 +250,7 @@ struct numpy_allocator_impl_tensor<Eigen::TensorRef<TensorType> > {
return
pyArray
;
}
else
{
return
NumpyAllocator
<
TensorType
>::
allocate
(
static_cast
<
Eigen
::
TensorBase
<
Eigen
::
TensorRef
<
TensorType
>
>
&>
(
tensor
),
nd
,
shape
);
return
NumpyAllocator
<
TensorType
>::
allocate
(
tensor
,
nd
,
shape
);
}
}
};
...
...
@@ -281,11 +278,7 @@ struct numpy_allocator_impl_tensor<const Eigen::TensorRef<const TensorType> > {
return
pyArray
;
}
else
{
return
NumpyAllocator
<
TensorType
>::
allocate
(
static_cast
<
const
Eigen
::
TensorBase
<
Eigen
::
TensorRef
<
const
TensorType
>
>
&>
(
tensor
),
nd
,
shape
);
return
NumpyAllocator
<
TensorType
>::
allocate
(
tensor
,
nd
,
shape
);
}
}
};
...
...
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