【发布时间】:2019-09-04 04:15:06
【问题描述】:
import torch
a = torch.Tensor(2,2,2)
b = myfunction(a)
print(a)
>>> [[[1,2],
[5,6]],
[[7,8],
[9,10]]]
print(b)
>>> [[1,2,7,8],
[5,6,9,10]]
如何编写 myfunction 以从 a 获取 b?
是否有一些 pytorch 函数可以以这种方式转换 a?
【问题讨论】: