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

Add usage example to math.poly_val #35425

Merged
merged 6 commits into from Feb 10, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tensorflow/python/ops/math_ops.py
Expand Up @@ -4228,6 +4228,12 @@ def polyval(coeffs, x, name=None):

p(x) = coeffs[n-1] + x * (coeffs[n-2] + ... + x * (coeffs[1] +
x * coeffs[0]))

Usage Example:
RichardXiao13 marked this conversation as resolved.
Show resolved Hide resolved
>>> coefficients = [1.0, 2.5, -4.2]
>>> x = 5.0
>>> y = tf.math.polyval(coefficients, x)
RichardXiao13 marked this conversation as resolved.
Show resolved Hide resolved
RichardXiao13 marked this conversation as resolved.
Show resolved Hide resolved
<y = 33.3>

Args:
coeffs: A list of `Tensor` representing the coefficients of the polynomial.
Expand Down