Added support for atleast_1d, atleast_2d, atleast_3d#689
Added support for atleast_1d, atleast_2d, atleast_3d#689hinriksnaer wants to merge 0 commit intoml-explore:mainfrom
Conversation
docs/src/python/atleast_utils.rst
Outdated
| @@ -0,0 +1,15 @@ | |||
| .. _utils: | |||
|
|
|||
| At least Utils | |||
There was a problem hiding this comment.
Don't need a separate page in the docs for this, I would just put them in the ops.rst list.
python/mlx/utils.py
Outdated
| return {k: tree_unflatten(v) for k, v in children.items()} | ||
|
|
||
|
|
||
| def atleast_1d(*values): |
There was a problem hiding this comment.
These should be implemented in C++ not Python and then bound to Python via Pybind (the same as all the rest of our ops).
awni
left a comment
There was a problem hiding this comment.
These should follow the implementation of all of our other ops (C++ and then bound to Python). Are you up for doing the C++ implementation?
|
Thanks for the feedback! Yes, I'll get started on implementing the functionality using C++. Just to be sure, I presume that you want the functionality to be added here, correct? Please let me know if there is anything else you would want me to know before getting started. |
|
That's exactly right! |
Proposed changes
Feature addition for the following issue. The code is based on the numpy implementation. PyTorch provides similar functionality but is limited to only Tensors and implements it in the C++ backend. Perhaps this is a good place to start?
Any feedback regarding the documentation, tests and implementation would be much appreciated.
Checklist
Put an
xin the boxes that apply.pre-commit run --all-filesto format my code / installed pre-commit prior to committing changes