kevinthesun commented on a change in pull request #4707: [Relay][Frontend][TF] 
Fix handling of 0D scalar Constant
URL: https://github.com/apache/incubator-tvm/pull/4707#discussion_r366892830
 
 

 ##########
 File path: python/tvm/relay/frontend/tensorflow.py
 ##########
 @@ -2400,9 +2400,7 @@ def _parse_param(self, key, value, name, shape):
 
             array_ndim = len(np_array.shape)
             if array_ndim == 0:
-                new_array = np.empty([1], dtype=np_array.dtype)
-                new_array[0] = np_array
-                self._nodes[name] = [tvm.relay.const(new_array)]
+                self._nodes[name] = [tvm.relay.const(np_array)]
 
 Review comment:
   Add a test 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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to