torch.vander#
- torch.vander(x, N=None, increasing=False) Tensor#
生成 Vandermonde 矩陣。
輸出矩陣的列是輸入向量的逐元素冪 . If increasing is True, the order of the columns is reversed . 這種每一行都包含幾何級數的矩陣是以 Alexandre-Theophile Vandermonde 的名字命名的。
- 引數
- 返回
Vandermonde 矩陣。如果 increasing 為 False,則第一列是 ,第二列是 ,以此類推。如果 increasing 為 True,則列為 。
- 返回型別
示例
>>> 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]])