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

Reformatting RELU function, added docstring examples #7082

Merged
merged 4 commits into from
Nov 17, 2022

Conversation

dimikave
Copy link
Contributor

No description provided.

@dimikave
Copy link
Contributor Author

dimikave commented Nov 15, 2022

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 📑:

    • ❌: Make sure that the aforementioned methods are added into the correct category-specific parent class, such as ivy.ArrayWithElementwise, ivy.ContainerWithManipulation etc.
    • ❌: 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/relu.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 Parameters and Returns sections.
          • ❌: Add out to the Parameters section if function accepts an out argument.
          • ❌: Replace out with ret in the Returns section.
    • ❌: Add thorough Docstring Examples for every function and its relevant methods and ensure they pass the docstring tests.

      Functional Examples in ivy/functional/relu.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:
          • ❌: out unused.
          • ❌: out used to update a new array y.
          • ❌: out used to inplace update the input array x (if x has the same dtype and shape as the return).
        • ❌: If broadcasting is relevant for the function, then show examples which highlight this.

      Nestable Function Examples in ivy/functional/relu.py.
      Only if the function supports nestable operations.

        • ❌: Add an example that passes in an ivy.Container instance in place of one of the arguments.
        • ❌: Add an example passes in ivy.Container instances for multiple arguments.

      Container Static Method Examples in ivy/container/relu.py.

        • ❌: The example from point (6.f) should be replicated, but added to the ivy.Container static method docstring in with ivy.<func_name> replaced with ivy.Container.static_<func_name> in the example.
        • ❌: The example from point (6.g) should be replicated, but added to the ivy.Container static method docstring, with ivy.<func_name> replaced with ivy.Container.static_<func_name> in the example.

      Array Instance Method Example in ivy/array/relu.py.

        • ❌: Call this instance method of the ivy.Array class.

      Container Instance Method Example in ivy/container/relu.py.

        • ❌: Call this instance method of the ivy.Container class.

      Array Operator Examples in ivy/array/array.py.

        • ❌: Call the operator on two ivy.Array instances.
        • ❌: Call the operator with an ivy.Array instance on the left and ivy.Container on the right.

      Array Reverse Operator Example in ivy/array/array.py.

        • ❌: Call the operator with a Number on the left and an ivy.Array instance on the right.

      Container Operator Examples in ivy/container/container.py.

        • ❌: Call the operator on two ivy.Container instances containing Number instances at the leaves.
        • ❌: Call the operator on two ivy.Container instances containing ivy.Array instances at the leaves.
        • ❌: Call the operator with an ivy.Container instance on the left and ivy.Array on the right.

      Container Reverse Operator Example in ivy/container/container.py.

        • ❌: Following example in the ivy.Container.__radd__ docstring, with the operator called with a Number on the left and an ivy.Container instance on the right.

      Tests

        • ❌: Docstring examples tests passing.
        • ❌: Lint checks passing.

@dimikave
Copy link
Contributor Author

Close #6982

@ivy-leaves ivy-leaves added Array API Conform to the Array API Standard, created by The Consortium for Python Data API Standards Ivy Functional API Function Reformatting Reformat all Ivy functions in accordance with the latest coding style in the contributor guide labels Nov 15, 2022
@dimikave
Copy link
Contributor Author

dimikave commented Nov 16, 2022

As far as I can see, the docstrings related tests that fail, seem to fail on other functions and not on relu. As for the other tests, I am not sure why they fail or if they fail in the original branch as well.

Looking forward for your review,
Thanks in advance

Copy link
Contributor

@Daniel4078 Daniel4078 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I only found one small error for you to fix. Thank you.

@dimikave dimikave requested a review from Daniel4078 November 17, 2022 14:22
Copy link
Contributor

@Daniel4078 Daniel4078 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

@Daniel4078 Daniel4078 merged commit 0cb8da8 into ivy-llc:master Nov 17, 2022
KevinUnadkat pushed a commit to KevinUnadkat/ivy that referenced this pull request Dec 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Array API Conform to the Array API Standard, created by The Consortium for Python Data API Standards Function Reformatting Reformat all Ivy functions in accordance with the latest coding style in the contributor guide Ivy Functional API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants