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 2019/12/15 12:43:20 UTC

[GitHub] [incubator-tvm] inadob commented on a change in pull request #4518: [Bugfix][Frontend][TF] Fix incorrect calculations in tf SLICE

inadob commented on a change in pull request #4518: [Bugfix][Frontend][TF] Fix incorrect calculations in tf SLICE
URL: https://github.com/apache/incubator-tvm/pull/4518#discussion_r357976150
 
 

 ##########
 File path: tests/python/frontend/tensorflow/test_forward.py
 ##########
 @@ -2209,14 +2209,14 @@ def _test_forward_slice_operation_input(input_value, begin_value, size_value):
     with tf.Graph().as_default():
         input_tensor = tf.placeholder(
             shape=input_data.shape, dtype=input_data.dtype, name="input")
-        begin_tensor = tf.expand_dims(begin_value, axis=0)
-        size_tensor = tf.expand_dims(size_value, axis=0)
-        slice_tensor = tf.slice(input_tensor, begin_tensor, size_tensor, name='slice_output')
+        tf.slice(input_tensor, begin_value, size_value, name='slice_output')
         compare_tf_with_tvm([input_data], ['input:0'], 'slice_output:0')
 
 
 def test_forward_slice():
-    _test_forward_slice_operation_input([1, 1], 0, 2)
+    _test_forward_slice_operation_input([1, 1], [0], [2])
 
 Review comment:
   Well, in the TF documentation is said that tf.slice() arguments **begin** & **size**  both should be tensors. I am aware that the scalars are 0D tensors but if the TF function, in general, doesn't accept scalars, then form my point of view, it doesn't make sense to test something that is not supposed to work like this.  

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


With regards,
Apache Git Services