fix bug when converting constant nodes with types of int64 or float64 (#6159)
authorsleepwalker2017 <1028552010@qq.com>
Wed, 29 Jul 2020 17:30:03 +0000 (01:30 +0800)
committerGitHub <noreply@github.com>
Wed, 29 Jul 2020 17:30:03 +0000 (10:30 -0700)
Co-authored-by: yuweilong <yuweilong03@meituan.com>
python/tvm/relay/frontend/tensorflow.py

index aa62702..a06b0ca 100644 (file)
@@ -2835,7 +2835,7 @@ class GraphProto(object):
 
             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)]
             else:
                 self._params[name] = tvm.nd.array(np_array)
                 self._nodes[name] = [_expr.var(name,