Reformat device
As explained in the function reformatting open task, each function in the device submodule should be updated to follow the implementation instructions given in the Deep Dive section of the docs. The updates should be applied for both the Ivy API and Backend API. The Deep Dive is the best general resource for learning in detail how functions should be implemented. Many of the functions are not implemented as they should be. You will need to make changes to the current implementations, but you do not need to go through all section of the Deep Dive. Specifically, you should make the following changes, where appropriate:
- remove all lambda and direct bindings for backend functions, with each function instead defined using def.
- update the function arguments and type hints.
- add the correct docstrings
- add thorough docstring examples
_
Please keep in mind that the proper way to link an issue to this list is to comment "- [ ] #issue_number" while the issue's title only includes the name of the function you've chosen.
_
- [ ] #26534
- [x] #26816
- [x] #1181
- [ ] #25749
- [x] #5498
- [x] #2515
- [x] #6291
- [x] #1755
- [x] #3986
- [x] #1826
- [x] #26072
- [ ] #26080
- [x] #1243
- [x] #6954
- [x] #25704
- [ ] #26142
- [x] #28199
- [x] #26091
- [x] #12906
- [x] #1764
- [x] #6957
- [ ] #25710
The main file paths where these functions are likely to be added are:
ivy/functional/ivy/device.py
@AnnaTz Just asking, where exactly this dev_from_str function is? I'm unable to locate it.
@joshiayush You're right, this function has been removed from our api since this list was composed. I will remove it here as well. Thanks for flagging!
I didn't see it, thanks
I just found out my PR #11940 is an spiritual successor to #1765, it got merged though!
@joshiayush You're right, this function has been removed from our api since this list was composed. I will remove it here as well. Thanks for flagging!
Also, there's no to_dev function it is to_device now.
- [ ] #14182
default_device is marked as closed when it should be marked as done, as wrong pull request is assigned to it. It was completed with #11942 as you can back track through pull request comments.
#814
I just completed my task for #26142
- [ ] #26080