apivovarov commented on a change in pull request #4484: [FRONTEND][TF] 
conv2d_transpose 'SAME' support kernel more than 1x1
URL: https://github.com/apache/incubator-tvm/pull/4484#discussion_r355859901
 
 

 ##########
 File path: tests/python/frontend/tensorflow/test_forward.py
 ##########
 @@ -362,10 +362,16 @@ def test_forward_convolution():
         _test_convolution('depthwise', [4, 12, 17, 17], [3, 3, 12, 2], [1, 1], 
[2, 2], 'VALID', 'NCHW')
         _test_convolution('conv_transpose', [4, 32, 8, 8], [1, 1, 176, 32], 
[1, 1], [1, 1], 'SAME',
                           'NCHW', [4, 176, 8, 8])
+        _test_convolution('conv_transpose', [4, 32, 8, 8], [2, 2, 176, 32], 
[1, 1], [1, 1], 'SAME',
+                          'NCHW', [4, 176, 8, 8])
+        _test_convolution('conv_transpose', [4, 32, 8, 8], [3, 3, 176, 32], 
[1, 1], [1, 1], 'SAME',
+                          'NCHW', [4, 176, 8, 8])
         _test_convolution('conv_transpose', [4, 19, 8, 8], [3, 3, 19, 19], [1, 
1], [2, 2], 'VALID',
                           'NCHW', [4, 19, 17, 17])
         _test_convolution('conv_transpose', [4, 19, 17, 17], [1, 1, 124, 19], 
[1, 1], [1, 1], 'SAME',
                           'NCHW', [4, 124, 17, 17])
+        _test_convolution('conv_transpose', [4, 19, 17, 17], [3, 3, 124, 19], 
[1, 1], [1, 1], 'SAME',
 
 Review comment:
   TF code for kernel 2x2, strides 2x2 and padding SAME is
   ```
   dshape=(1,5,5,4)
   #hwoi
   kshape=(2,2,2,4)
   oshape=(1,9,9,2)
   # or 
   oshape=(1,10,10,2)
   dtype='float32'
   with tf.Session() as sess:
       x = tf.placeholder(shape=dshape, dtype=dtype)
       w = tf.placeholder(shape=kshape, dtype=dtype)
       dc = tf.nn.conv2d_transpose(x, w, output_shape=oshape, 
strides=(1,2,2,1), padding='SAME')
   
       res_dc = sess.run(dc, feed_dict={x: data, w:weight})
   ```

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