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/06/01 04:20:48 UTC

[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #5699: [Frontend][TensorFlow] Improve Control Flow and TensorArray

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



##########
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:
       shape is set manually here.




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