tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] lixiaoquan commented on a change in pull request #5699: [Frontend][TensorFlow] Improve Control Flow and TensorArray
Date Mon, 01 Jun 2020 04:14:56 GMT

lixiaoquan commented on a change in pull request #5699:
URL: https://github.com/apache/incubator-tvm/pull/5699#discussion_r433034145



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -788,52 +797,21 @@ def _impl(inputs, attr, params, mod):
 
 def _tensor_array():
     def _impl(inputs, attr, params, prelude):
-        try:
-            from tensorflow.python.framework import tensor_util
-        except ImportError as e:
-            raise ImportError(
-                "Unable to import tensorflow which is required {}".format(e))
-
         dtype_str = attr.get('dtype').name
         assert not attr["dynamic_size"], "Dynamic size tensor array is " \
                                          "not supported in TVM yet."
 
-        raw_elem_shape = tensor_util.TensorShapeProtoToList(attr['element_shape'])
-        elem_shape = []
-        for dim in raw_elem_shape:
-            if dim < 0:
-                elem_shape.append(Any())
-            else:
-                elem_shape.append(dim)
-
-        if elem_shape:
-            # Element shape is specified.
-            # Directly create static tensor array with given shape.
+        if attr['identical_element_shapes']:
+            assert "shape" in attr, "Shape is required for static tensor array."

Review comment:
       Should it be element_shape?
   https://github.com/tensorflow/tensorflow/blob/a34091e538540aad57a7a941575538944f38db24/tensorflow/core/kernels/tensor_array_ops.cc#L165




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



Mime
View raw message