ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

[pnnx]:torch.tensordot convert failed

Open ljdang opened this issue 8 months ago • 0 comments

error log | 日志或报错信息 | ログ

model | 模型 | モデル

import torch
import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()

    def forward(self, x, y):
        x = torch.tensordot(x, y, dims=([1], [0]))
        return  x

model = Model()
model.eval()

input1 = torch.rand(3, 4)
input2 = torch.rand(4, 2)
trace = torch.jit.trace(model, (input1, input2))
trace.save('tensordot.pt')

how to reproduce | 复现步骤 | 再現方法

  1. pnnx tensordot.pt inputshape=[3,4],[4,2]
  2. 转换时错误信息如下:
fallback batch axis 233 for operand 0
fallback batch axis 233 for operand 1
fallback batch axis 233 for operand 2
fallback batch axis 233 for operand 3
fallback batch axis 233 for operand 4
ignore pnnx.Expression pnnx_expr_1 param expr=[1]
ignore pnnx.Expression pnnx_expr_0 param expr=[0]

ljdang avatar May 31 '24 02:05 ljdang