ncnn
ncnn copied to clipboard
请求支持torch.roll和torch.flip
error log | 日志或报错信息 | ログ
>>> x = torch.tensor([1, 2, 3, 4, 5, 6, 7, 8]).view(4, 2)
>>> x
tensor([[1, 2],
[3, 4],
[5, 6],
[7, 8]])
>>> torch.roll(x, 1)
tensor([[8, 1],
[2, 3],
[4, 5],
[6, 7]])
>>> torch.roll(x, 1, 0)
tensor([[7, 8],
[1, 2],
[3, 4],
[5, 6]])
>>> x = torch.arange(8).view(2, 2, 2)
>>> x
tensor([[[ 0, 1],
[ 2, 3]],
[[ 4, 5],
[ 6, 7]]])
>>> torch.flip(x, [0, 1])
tensor([[[ 6, 7],
[ 4, 5]],
[[ 2, 3],
[ 0, 1]]])
https://github.com/Tencent/ncnn/pull/5623
torch.topk等也支持一下呗,ncnn模型转换的泛化支持,真的很急。大部分新模型,都会卡在一两个op上,干着急
是支持了么? 还是显示不支持
torch.roll支持了;torch.flip仍然不支持 @zengjie617789
@Baiyuetribe 好的,谢谢。
https://github.com/Tencent/ncnn/pull/6233