Hi, I met a problem while trying to convert a torchscript model to tvm. The problem is that _frobenius_norm function in tvm/relay/frontend/pytorch.py cannot infer the axis correctly. axis in torch script model is a list of constant and tvm has trouble to infer the shape with that. Can anyone help with this?
I created a minimum sample for this. I use python3.7, pytorch==1.4.0, torchvision==0.5.0, tvm https://github.com/kevinthesun/tvm/tree/PTOD The minimum example is: import torch import numpy as np from tvm import relay from tvm.runtime.vm import VirtualMachine from tvm.runtime import profiler_vm
class pt_normalize(torch.nn.Module): def __init__(self): super().__init__() def forward(self, inp): out = torch.norm(inp, dim=1).unsqueeze(1) return out data = torch.rand(1,3,10,10) input_shape = (1,3,10,10) model =pt_normalize() trace_model = torch.jit.trace(model, data) input_name = 'input0' shape_list = [(input_name, input_shape)] mod, params = relay.frontend.from_pytorch(trace_model, shape_list)