tvm-commits mailing list archives

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

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -1177,18 +1137,26 @@ def _impl(inputs, attr, params, mod):
         except (IndexError, KeyError, AttributeError):
             # Handle symbolic begin
             try:
-                begin = _infer_value(inputs[1], params).asnumpy().tolist()
+                begin = _infer_value(inputs[1], params, mod).asnumpy().tolist()
             except Exception:
                 begin = inputs[1]
         try:
             size = _get_list_param(params, inputs[2])
         except (IndexError, KeyError, AttributeError):
             # Handle symbolic size
             try:
-                size = _infer_value(inputs[2], params).asnumpy().tolist()
+                size = _infer_value(inputs[2], params, mod).asnumpy().tolist()
             except Exception:
                 size = inputs[2]
-        return _op.strided_slice(inputs[0], begin=begin, end=size, slice_mode="size")
+
+        # Align begin and strides for dynamic shape.
+        data_dim = len(_infer_shape(inputs[0], mod))
+        strides = [1] * data_dim
+        if not isinstance(begin, (_expr.Call, _expr.Var)):
+            for _ in range(len(begin), data_dim):
+                begin.append(0)

Review comment:
       Added.




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