mindspore.numpy.polyval
- mindspore.numpy.polyval(p, x)[源代码]
Evaluates a polynomial at specific values. If p is of length N, this function returns the value:
p[0]*x**(N-1) + p[1]*x**(N-2) + ... + p[N-2]*x + p[N-1]
If x is a sequence, thenp(x)
is returned for each element of x. If x is another polynomial then the composite polynomialp(x(t))
is returned.说明
Numpy object poly1d is currently not supported.
- 参数
- 返回
Tensor.
- 异常
ValueError – If p has more than 1 dimensions.
- Supported Platforms:
Ascend
GPU
CPU
样例
>>> import mindspore.numpy as np >>> print(np.polyval([3.,0.,1.], 5.)) 76.0