jikechao opened a new issue, #15285:
URL: https://github.com/apache/tvm/issues/15285

   
   
   ### Actual behavior
   
   
![image](https://github.com/apache/tvm/assets/29506758/945f2f4e-46c8-4e02-8641-5a34e121aacc)
   
   
   
   ### Steps to reproduce
   ```
   import torch
   from tvm import relay
   import tvm
   import numpy as np
   from torch.nn import Module
   
   input_data = torch.randn([1, 256, 56, 56], dtype=torch.float32)
   para_1 = torch.randn([512, 256, 1, 1], dtype=torch.float32)
   para_2 = None
   para_3 = (2, 2)
   para_4 = (0, 0)
   para_5 = (1, 1)
   para_6 = 1
   class conv2d(Module):
       def forward(self, *args):
           return torch.nn.functional.conv2d(args[0], 
para_1,para_2,para_3,para_4,para_5,para_6,)
   
   m = conv2d().float().eval()
   
   torch_outputs = m(input_data)
   
   trace = torch.jit.trace(m, input_data)
   input_shapes = [('input0', torch.Size([1, 256, 56, 56]))]
   
   mod, params = relay.frontend.from_pytorch(trace, input_shapes)
   print(mod)
   with tvm.transform.PassContext(opt_level=3):
       exe = relay.create_executor('graph', mod=mod, params=params, 
device=tvm.device('llvm', 0), target='llvm').evaluate()
   
   input_tvm = {'input0': np.array(input_data, dtype='float32')}
   tvm_outputs = exe(**input_tvm).asnumpy()
   
   np.testing.assert_allclose(torch_outputs, tvm_outputs, rtol=1e-5, atol=1e-5) 
  # threshold is the same with that in equipped test cases in tvm repository
   ```
   
   ### Triage
   
   * needs-triage
   * frontend:pytorch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to