mindspore.ops.vander
- mindspore.ops.vander(x, N=None)[source]
Generates a Vandermonde matrix. The columns of the output matrix are powers of the input vector. The i-th output column is the input vector raised element-wise to the power of \(N - i - 1\).
- Parameters
- Returns
Tensor, the columns are \(x^0, x^1, ..., x^{(N-1)}\).
- Raises
TypeError – If input x is not Tensor.
ValueError – If x is not 1-D.
TypeError – If input N is not int.
ValueError – If N <= 0.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> from mindspore import Tensor, ops >>> a = Tensor([1., 2., 3., 5.]) >>> print(ops.vander(a, N=3)) [[1. 1. 1.] [4. 2. 1.] [9. 3. 1.] [25. 5. 1.]] >>> a = Tensor([1., 2., 3., 5.]) >>> print(ops.vander(a)) [[1. 1. 1. 1.] [8. 4. 2. 1.] [27. 9. 3. 1.] [125. 25. 5. 1.]]