Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Eigen::Tensor & Eigen::TensorMap support #4201

Merged
merged 141 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
fbf100c
First draft of Eigen::Tensor support
EthanSteinberg Sep 27, 2022
5a6fd06
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2022
a6a4bcd
Fix build errors
EthanSteinberg Sep 27, 2022
5996f80
Weird allocator stuff?
EthanSteinberg Sep 27, 2022
25a4d7e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2022
21c240b
Remove unused + additional allocator junk
EthanSteinberg Sep 27, 2022
7d49a31
Disable warning
EthanSteinberg Sep 27, 2022
f4292b5
Use constexpr
EthanSteinberg Sep 27, 2022
68f06e7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2022
a77b38c
clang tidy fixes
EthanSteinberg Sep 27, 2022
24e9120
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 27, 2022
ca2303c
Resolve comments
EthanSteinberg Sep 28, 2022
3a978dc
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2022
38fbc37
Remove auto constexpr function
EthanSteinberg Sep 28, 2022
bd6a679
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2022
8d64196
Try again for older C++
EthanSteinberg Sep 28, 2022
09557c5
Oops forgot constexpr
EthanSteinberg Sep 28, 2022
0a60475
Move to new files as suggested
EthanSteinberg Sep 28, 2022
11aac3a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 28, 2022
fb53ffd
Fix weird tests
EthanSteinberg Sep 28, 2022
03a0595
Fix nits
EthanSteinberg Sep 30, 2022
0b0fa22
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 30, 2022
5a7b9c5
Oops, forgot import
EthanSteinberg Sep 30, 2022
27377d9
Fix clang 3.6 bug
EthanSteinberg Sep 30, 2022
a4a96f3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 30, 2022
06a816c
More comprehensive test suite
EthanSteinberg Sep 30, 2022
d03a031
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 30, 2022
069f3fc
Refactor allocators to make things more clear
EthanSteinberg Oct 1, 2022
ea47cd1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 1, 2022
c343f4d
Switch to std::copy
EthanSteinberg Oct 1, 2022
25fc7a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 1, 2022
22c554d
Switch to DSizes instead of array
EthanSteinberg Oct 1, 2022
0a71637
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 1, 2022
8d1c6d0
Address feedback
EthanSteinberg Oct 3, 2022
98b2e12
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2022
cc59682
Fix python + dummy c++ change to trigger build
EthanSteinberg Oct 3, 2022
fda4a00
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2022
9153db5
Alignment
EthanSteinberg Oct 3, 2022
44681e0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 3, 2022
6c3bfa4
Add include guard
EthanSteinberg Oct 3, 2022
e01bbd8
Forgot inline
EthanSteinberg Oct 3, 2022
8ef248d
Fix compiler warning
EthanSteinberg Oct 3, 2022
ad8e987
Remove bad test
EthanSteinberg Oct 3, 2022
6bf2ffb
Better type signatures
EthanSteinberg Oct 3, 2022
ba79142
Add guards to make compiler requirements more explicit
EthanSteinberg Oct 4, 2022
880ef5d
style: pre-commit fixes
pre-commit-ci[bot] Oct 4, 2022
afcdf3e
Force rerun of tests due to flake
EthanSteinberg Oct 4, 2022
73ec5a5
style: pre-commit fixes
pre-commit-ci[bot] Oct 4, 2022
f548478
Keep pragmas & all related comments together, add PLEASE KEEP IN SYNC
Oct 4, 2022
8829b4b
Move headers out of detail
EthanSteinberg Oct 5, 2022
79ba4f3
style: pre-commit fixes
pre-commit-ci[bot] Oct 5, 2022
1a4b6a2
Fix cmake
Skylion007 Oct 5, 2022
e92231a
Improve casting
Skylion007 Oct 5, 2022
97358ea
style: pre-commit fixes
pre-commit-ci[bot] Oct 5, 2022
396f047
Add a ton more tests + refactor
EthanSteinberg Oct 5, 2022
992795b
Improve names
EthanSteinberg Oct 5, 2022
c364893
style: pre-commit fixes
pre-commit-ci[bot] Oct 5, 2022
72ace1b
Update include/pybind11/eigen/tensor.h
EthanSteinberg Oct 5, 2022
40a3976
Fix tests
EthanSteinberg Oct 5, 2022
908da62
style: pre-commit fixes
pre-commit-ci[bot] Oct 5, 2022
e8c06c8
Update
EthanSteinberg Oct 5, 2022
2dd6c95
Add a test to verify that strange numpy arrays work
EthanSteinberg Oct 5, 2022
a3387c3
Fix dumb compiler warning
EthanSteinberg Oct 5, 2022
b41ff6e
Better tests
EthanSteinberg Oct 5, 2022
4a7179d
Better tests
EthanSteinberg Oct 5, 2022
a754455
Fix tests
EthanSteinberg Oct 6, 2022
9ae8a2f
style: pre-commit fixes
pre-commit-ci[bot] Oct 6, 2022
ac263f0
More test fixes
EthanSteinberg Oct 6, 2022
5265a81
style: pre-commit fixes
pre-commit-ci[bot] Oct 6, 2022
9477519
A ton more test coverage
EthanSteinberg Oct 6, 2022
891dab8
Fix tests
EthanSteinberg Oct 7, 2022
18b06dc
style: pre-commit fixes
pre-commit-ci[bot] Oct 6, 2022
37230b8
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
185d3d5
Add back constexpr
EthanSteinberg Oct 7, 2022
c3b30a1
Another test
EthanSteinberg Oct 7, 2022
ca04326
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
b105dd2
Improve tests
Skylion007 Oct 7, 2022
8636d0f
Whoops
Skylion007 Oct 7, 2022
bf36e9f
Less magic numbers
Skylion007 Oct 7, 2022
9dd00c2
Update tests/test_eigen_tensor.py
EthanSteinberg Oct 7, 2022
aeeda40
Update tests/test_eigen_tensor.py
EthanSteinberg Oct 7, 2022
a2e915b
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
d46603d
Fix tests
EthanSteinberg Oct 7, 2022
55addec
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
17eed83
Fix memory leak
EthanSteinberg Oct 7, 2022
7a09efb
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
57a45e1
Fix order
EthanSteinberg Oct 7, 2022
9bdb366
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
51bdba8
Add test to make sure unsafe casts fail
EthanSteinberg Oct 7, 2022
9ef5aa7
Minor bug fix to work on 32 bit machines
EthanSteinberg Oct 7, 2022
ed09040
Implement convert flag
EthanSteinberg Oct 7, 2022
8547ee0
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
a03ad09
Switch to correct TensorMap const use
EthanSteinberg Oct 7, 2022
db7d390
style: pre-commit fixes
pre-commit-ci[bot] Oct 7, 2022
105d973
Support older versions of eigen
EthanSteinberg Oct 8, 2022
c96a56d
Weird c++ compilers
EthanSteinberg Oct 8, 2022
e236da2
Fix Eigen bug
EthanSteinberg Oct 8, 2022
5343d86
Fix another eigen bug
EthanSteinberg Oct 8, 2022
7beab7b
Yet another eigen bug
EthanSteinberg Oct 8, 2022
9f4dfff
Potential flakes?
EthanSteinberg Oct 8, 2022
2c904a0
style: pre-commit fixes
pre-commit-ci[bot] Oct 8, 2022
b7664b0
Rerun tests with dummy exception to find out what is going on
EthanSteinberg Oct 8, 2022
d730694
Another dummy test run
EthanSteinberg Oct 8, 2022
d5b73c7
Ablate more
EthanSteinberg Oct 8, 2022
e85c92b
Found the broken test?
EthanSteinberg Oct 8, 2022
e490133
One step closer
EthanSteinberg Oct 8, 2022
3fc8eea
one step further
EthanSteinberg Oct 8, 2022
0c766c9
Double check
EthanSteinberg Oct 8, 2022
08278ee
one thing at a time
EthanSteinberg Oct 8, 2022
2291c5b
Give up and disable the test
EthanSteinberg Oct 8, 2022
0e24004
Clang lies about being gcc
EthanSteinberg Oct 8, 2022
0f06d2f
Oops, fix matrix test
EthanSteinberg Oct 8, 2022
a731b21
style: pre-commit fixes
pre-commit-ci[bot] Oct 8, 2022
9744995
Add tests to verify scalar conversions
EthanSteinberg Oct 9, 2022
4dbd3e5
style: pre-commit fixes
pre-commit-ci[bot] Oct 9, 2022
a5998c5
Fix nits
EthanSteinberg Oct 10, 2022
5946c86
Support no_array
EthanSteinberg Oct 11, 2022
fdbf004
Fix tests
EthanSteinberg Oct 11, 2022
49aaf0c
style: pre-commit fixes
pre-commit-ci[bot] Oct 11, 2022
d17a9f5
Silence compiler warning
EthanSteinberg Oct 11, 2022
7ab8364
Improve build system for ancient compilers
EthanSteinberg Oct 11, 2022
fff0c96
Make clang happy
EthanSteinberg Oct 11, 2022
17dc4ab
Make gcc happy
EthanSteinberg Oct 11, 2022
645634d
Implement Skylion's suggestions
EthanSteinberg Oct 11, 2022
cd40d68
Fix warning
EthanSteinberg Oct 11, 2022
e9639fc
Inline const pointer check
EthanSteinberg Oct 11, 2022
e69a79e
Implement suggestions
EthanSteinberg Oct 11, 2022
dc86d35
style: pre-commit fixes
pre-commit-ci[bot] Oct 11, 2022
5ea37fd
Improve tests
EthanSteinberg Oct 11, 2022
a53f0c7
Typo
EthanSteinberg Oct 11, 2022
b7e0058
style: pre-commit fixes
pre-commit-ci[bot] Oct 11, 2022
3a95d46
Support Google's build environment
EthanSteinberg Oct 12, 2022
7516e99
style: pre-commit fixes
pre-commit-ci[bot] Oct 12, 2022
4870a38
Update include/pybind11/eigen/tensor.h
EthanSteinberg Oct 12, 2022
51d4a46
style: pre-commit fixes
pre-commit-ci[bot] Oct 12, 2022
96e0802
Test cleanup per Skylion
EthanSteinberg Oct 12, 2022
74d5089
Switch to remvove_cv_t
EthanSteinberg Oct 12, 2022
39b4478
Cleaner test
EthanSteinberg Oct 12, 2022
bf6ae7a
style: pre-commit fixes
pre-commit-ci[bot] Oct 12, 2022
8b43c4d
Remove tensor from eigen.h, update tests
EthanSteinberg Oct 18, 2022
4880e0b
style: pre-commit fixes
pre-commit-ci[bot] Oct 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ pybind11Targets.cmake
/pybind11/share/*
/docs/_build/*
.ipynb_checkpoints/
tests/main.cpp
EthanSteinberg marked this conversation as resolved.
Show resolved Hide resolved
EthanSteinberg marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ set(PYBIND11_HEADERS
include/pybind11/complex.h
include/pybind11/options.h
include/pybind11/eigen.h
include/pybind11/eigen/matrix.h
include/pybind11/eigen/tensor.h
include/pybind11/embed.h
include/pybind11/eval.h
include/pybind11/gil.h
Expand Down
703 changes: 1 addition & 702 deletions include/pybind11/eigen.h

Large diffs are not rendered by default.

713 changes: 713 additions & 0 deletions include/pybind11/eigen/matrix.h

Large diffs are not rendered by default.

Loading