【发布时间】:2019-07-08 21:53:02
【问题描述】:
我有一个尺寸为(1,3, 375, 1242) 的张量。我想通过在其中添加填充将其重塑为(1, 3, 384, 1248)。我如何在 Pytorch c++ API 中做到这一点。提前谢谢你。
target = torch.zeros(1, 3, 384, 1248)
source = torch.ones(1, 3, 375, 1242)
target[: , : , :375, :1242] = source
【问题讨论】: