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
Guilhem Saurel
eigenpy
Commits
2215ca51
Verified
Commit
2215ca51
authored
2 years ago
by
Justin Carpentier
Browse files
Options
Downloads
Patches
Plain Diff
core: fix type for TensorRef
parent
cb54c9aa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/eigenpy/eigen-allocator.hpp
+5
-5
5 additions, 5 deletions
include/eigenpy/eigen-allocator.hpp
with
5 additions
and
5 deletions
include/eigenpy/eigen-allocator.hpp
+
5
−
5
View file @
2215ca51
...
...
@@ -344,7 +344,6 @@ struct eigen_allocator_impl_tensor {
/// \brief Copy Python array into the input matrix mat.
template
<
typename
TensorDerived
,
int
AccessLevel
>
static
void
copy
(
PyArrayObject
*
pyArray
,
const
Eigen
::
TensorBase
<
TensorDerived
,
AccessLevel
>
&
tensor_
)
{
TensorDerived
&
tensor
=
const_cast
<
TensorDerived
&>
(
static_cast
<
const
TensorDerived
&>
(
tensor_
));
...
...
@@ -649,14 +648,15 @@ struct eigen_allocator_impl_tensor_ref {
void
*
raw_ptr
=
storage
->
storage
.
bytes
;
if
(
need_to_allocate
)
{
TensorType
*
tensor_ptr
;
tensor_ptr
=
details
::
init_tensor
<
TensorType
>::
run
(
pyArray
);
typedef
typename
boost
::
remove_const
<
TensorType
>::
type
TensorTypeNonConst
;
TensorTypeNonConst
*
tensor_ptr
;
tensor_ptr
=
details
::
init_tensor
<
TensorTypeNonConst
>::
run
(
pyArray
);
RefType
tensor_ref
(
*
tensor_ptr
);
new
(
raw_ptr
)
StorageType
(
tensor_ref
,
pyArray
,
tensor_ptr
);
RefType
&
tensor
=
*
reinterpret_cast
<
RefType
*>
(
raw
_ptr
)
;
EigenAllocator
<
TensorType
>::
copy
(
pyArray
,
tensor
);
TensorTypeNonConst
&
tensor
=
*
tensor
_ptr
;
EigenAllocator
<
TensorType
NonConst
>::
copy
(
pyArray
,
tensor
);
}
else
{
assert
(
pyArray_type_code
==
Scalar_type_code
);
typename
NumpyMap
<
TensorType
,
Scalar
,
Options
>::
EigenMap
numpyMap
=
...
...
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