source_embs = torch.cat(embs)
时间: 2024-06-04 08:10:48 浏览: 146
torque source code
3星 · 编辑精心推荐
This code concatenates a list of PyTorch tensors (embs) into a single tensor (source_embs) along the first dimension.
For example, if embs is a list of 3 tensors with shape (2, 4), (2, 4), and (2, 4), respectively, then the resulting source_embs tensor will have shape (6, 4) since it will concatenate the tensors along the first dimension, resulting in a tensor with 6 rows (the sum of the rows of the original tensors) and 4 columns.
阅读全文