假設我有內存列表。每個元素都是形狀的pytorch張量。list_of_tensors = [tensor1, tensor2, tensor3, tensor4](1, 1, 84, 84)我想連接張量列表以獲得形狀的張量。 也許肯定會允許我這樣做。 必須是張量的元組,所以或不起作用。(4, 1, 84, 84)torch.cat(TT, dim=0)TTtorch.cat(*list_of_tensors, dim=0)torch.cat((*list_of_tensors), dim=0)如何使用和創建新的形狀張量list_of_tensorstorch.cat(???, dim=0)(4, 1, 84, 84)
* (張量張量的元組,名稱 dim,張量輸出)
慕的地6264312
2022-09-27 09:51:59