torch.vander¶
- torch.vander(x, N=None, increasing=False) 张量 ¶
生成一个范德蒙矩阵。
输出矩阵的列是输入向量的逐元素幂,即 。 如果 increasing 为 True,则列的顺序将反转 。这种每行都具有几何级数的矩阵以 Alexandre-Theophile Vandermonde 的名字命名。
- Parameters
- Returns
范德蒙矩阵。如果 increasing 为 False,第一列是 , 第二列是 ,以此类推。如果 increasing 为 True,则列 为 。
- Return type
示例:
>>> x = torch.tensor([1, 2, 3, 5]) >>> torch.vander(x) tensor([[ 1, 1, 1, 1], [ 8, 4, 2, 1], [ 27, 9, 3, 1], [125, 25, 5, 1]]) >>> torch.vander(x, N=3) tensor([[ 1, 1, 1], [ 4, 2, 1], [ 9, 3, 1], [25, 5, 1]]) >>> torch.vander(x, N=3, increasing=True) tensor([[ 1, 1, 1], [ 1, 2, 4], [ 1, 3, 9], [ 1, 5, 25]])