-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Missing numpy functions #619
Conversation
4c2f912
to
4b5f1d9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, excellent
b35f402
to
7e242c1
Compare
I rebased this branch on top of the latest master branch. |
89ca2cc
to
e76e885
Compare
Added missing |
Also great work on this! 🥳 After merging the other two (and having dropped 1.4 support), CI should pass for this one too. Can never remember whether you'll need to rebase onto the then-master without 1.4 though. |
e76e885
to
a21ec7c
Compare
Also tweaks the assert messages of the diagonal() proc a little to match similar messages in the new functions.
Tests have been added to test_diag.nim which will be renamed to test_special_matrices.nim.
Also adds messages to a couple of asserts on the linspace procedure.
Also adds a corresponding test.
…ar` module in all docstrings.
`flatten` flattens a tensor, returning a rank-1 tensor with the same data as the input. This is the same as `t.reshape([t.size.int])`. Therefore, if possible no data copy is done and the returned tensor shares data with the input. If input is not contiguous, this is not possible and a copy will be made.
Support for higher rank tensors will be added later.
This adds two roll types (which are the same for rank 1 tensors, but different for higher rank tensors): "global" (axis-less) roll and "axis" roll. The former flattens the input tensor before rolling the elements and then reshapes the rolled tensor back to the original shape, while the latter rolls the positions of _slices_ of a tensor taken along a specific axis.
a21ec7c
to
fbe2ce8
Compare
Thanks again! Great work. 🚀 |
This PR adds a number of missing numpy functions:
I'd like to add more but I think this is a good first set.