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
Improve math_ops.py docs #34014
Improve math_ops.py docs #34014
Conversation
Added usage examples to the tf.math.cumsum() docstring. What exists currently is syntax-like declarations and not `self contained` code samples.
Added a usage example and description of the function parameters and return values
@yashk2810 can you help re-review this. I've cleared some commits off the log from the previous pull request (referenced above). Thanks |
```python | ||
tf.cumsum([a, b, c], exclusive=True) # [0, a, a + b] | ||
``` | ||
# tf.cumsum([a, b, c], exclusive=True) => [0, a, a + b] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a newline before this comment and everywhere else?
Something like this
By setting the `exclusive` kwarg to `True`, an exclusive cumsum is performed instead:
# tf.cumsum([a, b, c], exclusive=True) => [0, a, a + b]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes implemented as requested
9d57f02
to
56aea64
Compare
The ubuntu cpu test was failing at tf.cumsum so I've made minor changes to the doctest to make it pass. |
56aea64
to
6f2c716
Compare
ubuntu sanity check was failing due to a pylint error( |
PiperOrigin-RevId: 279851681 Change-Id: Icf3296866d10ac23e2e2e50199a73a84cbb4becf
No description provided.