📜  pytorch view -1 含义 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:02.233000             🧑  作者: Mango

代码示例2
If there is any situation that you don't know how many rows you want but are sure of the number of columns, then you can specify this with a -1. (Note that you can extend this to tensors with more dimensions. Only one of the axis value can be -1). This is a way of telling the library: "give me a tensor that has these many columns and you compute the appropriate number of rows that is necessary to make this happen".