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

Hide ArithmeticGenericOp doc and disallow __bool__ #2538

Merged
merged 5 commits into from
Dec 14, 2020

Conversation

klecki
Copy link
Contributor

@klecki klecki commented Dec 10, 2020

Signed-off-by: Krzysztof Lecki klecki@nvidia.com

Why we need this PR?

Hides a doc of internal operator, prohibit using __bool__ on DataNodes.

What happened in this PR?

  • What solution was applied:
    ArithmeticGenericOp is no longer internal (it was already loaded) - this allows for loading it with regular functionality and properly handles hiding its docstring. MakeDocHidden() was added.
    __bool__ for DataNode was defined to always raise TypeError to prohibit mixing DataNodes with eager Python functions like min instead of using dali.math.min.
  • Affected modules and functionalities:
    SupportedOps doc, Arithm Ops
  • Key points relevant for the review:
    👀
  • Validation and testing:
    👀
    Tests for broken cases added.
  • Documentation (including examples):
    yes

JIRA TASK: [Use DALI-XXXX or NA]

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki klecki marked this pull request as draft December 10, 2020 15:17
Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki klecki changed the title Hide ArithmeticGenericOp doc Hide ArithmeticGenericOp doc and disallow __bool__ Dec 10, 2020
@klecki klecki marked this pull request as ready for review December 10, 2020 16:19
@klecki
Copy link
Contributor Author

klecki commented Dec 10, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1884565]: BUILD STARTED


@raises(TypeError)
def test_bool_raises():
bool(DataNode("dummy"))
Copy link
Contributor

Choose a reason for hiding this comment

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

new line

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1884565]: BUILD FAILED

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor Author

klecki commented Dec 11, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1893000]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1893000]: BUILD FAILED

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor Author

klecki commented Dec 11, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1893802]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1893802]: BUILD FAILED

Signed-off-by: Krzysztof Lecki <klecki@nvidia.com>
@klecki
Copy link
Contributor Author

klecki commented Dec 14, 2020

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1901936]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [1901936]: BUILD PASSED

@klecki klecki merged commit e465935 into NVIDIA:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants