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

 ##########
 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:
   Is it better to add below lines inside `_test_forward_slice_operation_input` 
to also accept begin_value, size_value input as a single int?
   ```
       begin_value = [begin_value] if isinstance(begin_value, int) else 
begin_value
       size_value = [size_value] if isinstance(size_value, int) else size_value
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to