10.22Pytorch日志

it2026-09-27  17

x = torch.randn(2, 3) print(x) y = x.view((1, 1) + x.shape) print(y) 输出 tensor[[…]] tensor[[ [[]] ]] (增加了两个维度)

torch.stack: 沿着一个新维度对输入张量序列进行连接。 序列中所有的张量都应该为相同形状

最新回复(0)