updated _compute_cost_and_update_grads function to specifications (Close #756)
- followed the 4 steps including referring back to the deep dive page
- replaced lambda with a nested function 'cost_fn_with_variables' (parameter v)inside the main function
- added doctoring with example based off the sections provided in deep dive.
not sure if I should have put any decorators, also this is my first time using GitHub, the whole repo is so intuitive!
If you are working on an open task, please edit the PR description to link to the issue you've created.
For more information, please check ToDo List Issues Guide.
Thank you :hugs:
Hey @rereversed 🙂, thanks for contributing! But could you edit the description with Close #Issue_number, as explained here so everything's properly linked and we know what's being changed and for what purpose.
Hey @rereversed 🙂, thanks for contributing! But could you edit the description with
Close #Issue_number, as explained here so everything's properly linked and we know what's being changed and for what purpose.
Thanks for reminding me, totally missed it ! What should I do now?
open #18004
Close #18275
Reformatting Task Checklist
IMPORTANT NOTICE 🚨:
The Ivy Docs represent the ground truth for the task descriptions and this checklist should only be used as a supplementary item to aid with the review process.
LEGEND 🗺:
- ❌ : Check item is not completed.
- ✅ : Check item is ready for review.
- 🆘 : Stuck/Doubting implementation (PR author should add comments explaining why).
- ⏩ : Check is not applicable to function (skip).
- 🆗 : Check item is already implemented and does not require any edits.
CHECKS 📑:
-
- [ ] ✅: Remove all lambda and direct bindings for the backend functions in:
-
- [ ]✅: Implement the following if they don't exist:
-
- [ ] ✅: The
ivy.Arrayinstance method in ivy/data_classes/array/meta.py.
- [ ] ✅: The
-
- [ ] ✅: The
ivy.Arrayspecial method in ivy/data_classes/array/array.py.
- [ ] ✅: The
-
- [ ] ✅: The
ivy.Arrayreverse special method in ivy/data_classes/array/array.py.
- [ ] ✅: The
-
- [ ] ✅: The
ivy.Containerstatic method in ivy/data_classes/container/meta.py.
- [ ] ✅: The
-
- [ ] ✅: The
ivy.Containerinstance method in ivy/data_classes/container/meta.py.
- [ ] ✅: The
-
- [ ] ✅: The
ivy.Containerspecial method in ivy/data_classes/container/container.py.
- [ ] ✅: The
-
- [ ] ✅: The
ivy.Containerreverse special method in ivy/data_classes/container/container.py.
- [ ] ✅: The
-
- [ ]✅: Implement the following if they don't exist:
-
- [ ]✅: Make sure that the aforementioned methods are added into the correct category-specific parent class, such as
ivy.ArrayWithElementwise,ivy.ContainerWithManipulationetc.
- [ ]✅: Make sure that the aforementioned methods are added into the correct category-specific parent class, such as
-
- [ ] ✅: Correct all of the Function Arguments and the type hints for every function and its relevant methods, including those you did not implement yourself.
-
- [ ] ✅ : Add the correct Docstrings to every function and its relevant methods, including those you did not implement yourself. The following should be added:
-
- [ ] ✅ : The function's Array API standard description in ivy/functional/meta.py. If the function is not part of the Array API standard then a description of similar style should be added to the same file.
The following modifications should be made to the description:
- [ ] ✅ : Remove type definitions in the
ParametersandReturnssections. - [ ] ✅ : Add
outto theParameterssection if function accepts anoutargument. - [ ] ✅ : Replace
outwithretin theReturnssection.
- [ ] ✅ : Remove type definitions in the
- [ ] ✅ : The function's Array API standard description in ivy/functional/meta.py. If the function is not part of the Array API standard then a description of similar style should be added to the same file.
The following modifications should be made to the description:
-
- [ ] ✅ : Reference to docstring for ivy.function_name (5.a) for the function description and modified
ParametersandReturnssections as described in the docs in:- [ ] ✅: ivy/array/meta.py.
- [ ] ✅: ivy/container/meta.py (in the static and instance method versions).
- [ ] ✅: ivy/array/array.py if the function has a special method ( like
__function_name__). - [ ] ✅: ivy/array/array.py if the function has a reverse special method ( like
__rfunction_name__). - [ ] ✅: ivy/container/container.py if the function has a special method ( like
__function_name__). - [ ] ✅: ivy/container/container.py if the function has a reverse special method ( like
__rfunction_name__).
- [ ] ✅ : Reference to docstring for ivy.function_name (5.a) for the function description and modified
-
- [ ] ✅ : Add the correct Docstrings to every function and its relevant methods, including those you did not implement yourself. The following should be added:
-
-
[ ] ✅ : Add thorough Docstring Examples for every function and its relevant methods and ensure they pass the docstring tests.
Functional Examples in ivy/functional/meta.py.
-
- [ ] ✅ : Cover all possible variants for each of the arguments independently (not combinatorily).
-
- [ ] ✅ : Vary the values and input shapes considerably between examples.
-
- [ ] ✅ : Start out simple and get more complex with each example.
-
- [ ] ✅ : Show an example with:
- [ ] ✅ :
outunused. - [ ] ✅ :
outused to update a new array y. - [ ] ✅ :
outused to inplace update the input array x (if x has the same dtype and shape as the return).
- [ ] ✅ :
- [ ] ✅ : Show an example with:
-
- [ ] ⏩: If broadcasting is relevant for the function, then show examples which highlight this.
Nestable Function Examples in ivy/functional/meta.py. Only if the function supports nestable operations.
-
- [ ] ✅: Add an example that passes in an
ivy.Containerinstance in place of one of the arguments.
- [ ] ✅: Add an example that passes in an
-
- [ ] ✅: Add an example passes in
ivy.Containerinstances for multiple arguments.
- [ ] ✅: Add an example passes in
Container Static Method Examples in ivy/container/meta.py.
-
- [ ] ✅: The example from point (6.f) should be replicated, but added to the
ivy.Containerstatic method docstring in withivy.<func_name>replaced withivy.Container.static_<func_name>in the example.
- [ ] ✅: The example from point (6.f) should be replicated, but added to the
-
- [ ] ✅: The example from point (6.g) should be replicated, but added to the
ivy.Containerstatic method docstring, withivy.<func_name>replaced withivy.Container.static_<func_name>in the example.
- [ ] ✅: The example from point (6.g) should be replicated, but added to the
Array Instance Method Example in ivy/array/meta.py.
-
- [ ] ✅: Call this instance method of the
ivy.Arrayclass.
- [ ] ✅: Call this instance method of the
Container Instance Method Example in ivy/container/meta.py.
-
- [ ] ✅: Call this instance method of the
ivy.Containerclass.
- [ ] ✅: Call this instance method of the
Array Operator Examples in ivy/array/array.py.
-
- [ ] ✅: Call the operator on two
ivy.Arrayinstances.
- [ ] ✅: Call the operator on two
-
- [ ] ✅: Call the operator with an
ivy.Arrayinstance on the left andivy.Containeron the right.
- [ ] ✅: Call the operator with an
Array Reverse Operator Example in ivy/array/array.py.
-
- [ ] ✅: Call the operator with a
Numberon the left and anivy.Arrayinstance on the right.
- [ ] ✅: Call the operator with a
Container Operator Examples in ivy/container/container.py.
-
- [ ] ✅: Call the operator on two
ivy.Containerinstances containing Number instances at the leaves.
- [ ] ✅: Call the operator on two
-
- [ ] ✅: Call the operator on two
ivy.Containerinstances containingivy.Arrayinstances at the leaves.
- [ ] ✅: Call the operator on two
-
- [ ] ✅: Call the operator with an
ivy.Containerinstance on the left andivy.Arrayon the right.
- [ ] ✅: Call the operator with an
Container Reverse Operator Example in ivy/container/container.py.
-
- [ ] ✅: Following example in the
ivy.Container.__radd__docstring, with the operator called with aNumberon the left and anivy.Containerinstance on the right.
- [ ] ✅: Following example in the
Tests
-
- [ ]✅: Docstring examples tests passing.
-
- [ ] 🆘: Lint checks passing.
-
-
This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.
This PR has been closed because it has been marked as stale for more than 7 days with no activity.