You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:46:27 UTC

[GitHub] [incubator-tvm] sleepwalker2017 opened a new pull request #6159: [Relay][TF][BugFix] when converting constant nodes with types of int64 or float64

sleepwalker2017 opened a new pull request #6159:
URL: https://github.com/apache/incubator-tvm/pull/6159


   when creating a constant node in relay, if dtype is not specified, inputs with int64 type will be converted to int32 type, which may cause error in following data type checks.
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #6159: [Relay][TF][BugFix] when converting constant nodes with types of int64 or float64

Posted by GitBox <gi...@apache.org>.
kevinthesun commented on a change in pull request #6159:
URL: https://github.com/apache/incubator-tvm/pull/6159#discussion_r462067898



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -2835,7 +2835,7 @@ def _parse_param(self, key, value, name, shape):
 
             array_ndim = len(np_array.shape)
             if array_ndim == 0:
-                self._nodes[name] = [tvm.relay.const(np_array)]
+                self._nodes[name] = [tvm.relay.const(np_array, np_array.dtype)]

Review comment:
       Do we also need to fix non-scalar case?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] kevinthesun merged pull request #6159: [Relay][TF][BugFix] when converting constant nodes with types of int64 or float64

Posted by GitBox <gi...@apache.org>.
kevinthesun merged pull request #6159:
URL: https://github.com/apache/incubator-tvm/pull/6159


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] sleepwalker2017 commented on a change in pull request #6159: [Relay][TF][BugFix] when converting constant nodes with types of int64 or float64

Posted by GitBox <gi...@apache.org>.
sleepwalker2017 commented on a change in pull request #6159:
URL: https://github.com/apache/incubator-tvm/pull/6159#discussion_r462082512



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -2835,7 +2835,7 @@ def _parse_param(self, key, value, name, shape):
 
             array_ndim = len(np_array.shape)
             if array_ndim == 0:
-                self._nodes[name] = [tvm.relay.const(np_array)]
+                self._nodes[name] = [tvm.relay.const(np_array, np_array.dtype)]

Review comment:
       For non-scalar cases, it goes to self._params[name] = tvm.nd.array(np_array).
   Seems the tvm.nd.array function doesn't have a default dtype, it always gets dtype from np_array. While tvm.relay.const has a default param dtype set to None.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] kevinthesun commented on pull request #6159: [Relay][TF][BugFix] when converting constant nodes with types of int64 or float64

Posted by GitBox <gi...@apache.org>.
kevinthesun commented on pull request #6159:
URL: https://github.com/apache/incubator-tvm/pull/6159#issuecomment-665798987


   Thanks @sleepwalker2017 


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org