mindspore.ops.vander

查看源文件
mindspore.ops.vander(x, N=None)[源代码]

生成一个范德蒙矩阵。 返回矩阵的各列是入参各元素的幂。第 i 个输出列是输入向量元素的幂,其幂为 Ni1

参数:
  • x (Tensor) - 一维输入tensor。

  • N (int,可选) - 返回矩阵的列数。默认 None ,为 len(x)

返回:

Tensor

支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> input = mindspore.tensor([1., 2., 3., 5.])
>>> output = mindspore.ops.vander(input)
>>> print(output)
[[  1.   1.   1.   1.]
 [  8.   4.   2.   1.]
 [ 27.   9.   3.   1.]
 [125.  25.   5.   1.]]
>>> output = mindspore.ops.vander(input, N=3)
>>> print(output)
[[ 1.  1.  1.]
 [ 4.  2.  1.]
 [ 9.  3.  1.]
 [25.  5.  1.]]