This is an automated email from the ASF dual-hosted git repository.

masahi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 604b263dd5 [BugFix] [Relay][Pytorch] Fix missing `.dtype`  (#16167)
604b263dd5 is described below

commit 604b263dd5834f8bd96dc1876f4bad74100f692b
Author: Masahiro Hiramori <mhg00...@gmail.com>
AuthorDate: Tue Nov 28 00:09:37 2023 -0800

    [BugFix] [Relay][Pytorch] Fix missing `.dtype`  (#16167)
    
    Fix missing `.dtype`
---
 python/tvm/relay/frontend/pytorch.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/tvm/relay/frontend/pytorch.py 
b/python/tvm/relay/frontend/pytorch.py
index 9374a24912..30711de0a7 100644
--- a/python/tvm/relay/frontend/pytorch.py
+++ b/python/tvm/relay/frontend/pytorch.py
@@ -847,7 +847,7 @@ class PyTorchOpConverter:
             dtype = _convert_dtype_value(inputs[2])
         else:
             # if dtype is None, use the dtype of the input tensor
-            dtype = self.infer_type(inputs[0])
+            dtype = self.infer_type(inputs[0]).dtype
         return self.full_impl(data, 0, dtype)
 
     def full(self, inputs, input_types):
@@ -898,7 +898,7 @@ class PyTorchOpConverter:
             dtype = _convert_dtype_value(inputs[3])
         else:
             # if dtype is None, use the dtype of the input tensor
-            dtype = self.infer_type(inputs[0])
+            dtype = self.infer_type(inputs[0]).dtype
 
         return self.full_impl(data, fill_value, dtype)
 

Reply via email to