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 2022/01/13 06:31:36 UTC

[GitHub] [tvm] blackkker commented on a change in pull request #9840: [Relay/Frontend][TFLite] Change the output shape calculation based on keep_dim option in fully connected

blackkker commented on a change in pull request #9840:
URL: https://github.com/apache/tvm/pull/9840#discussion_r783663051



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -1911,6 +1911,14 @@ def convert_fully_connected(self, op):
             weight_expr = self.exp_tab.new_const(weight_value, dtype=weight_tensor_type_str)
         weight_shape = _infer_shape(weight_expr)
 
+        # Change the output shape calculation based on keep_dim option

Review comment:
       As the document said, I constructed the keras model with tf.keras.Input(shape=(1, 1, 768)) and tf.keras.layers.Dense(1001).
   ![code](https://user-images.githubusercontent.com/32191045/149277656-43fa4989-d665-4b7a-b21f-3e12cb02637b.png)
   And then i converted it to TFLite but got a fully connected op(keep_num_dims : False). 
   The specific implment in TFLite is to reshape into 2 dims before fullyconnect, and then reshape the output into 4dims.
   ![fullyconnected](https://user-images.githubusercontent.com/32191045/149277660-368e1efd-6c2f-454f-beb8-09874644f693.png)
   BTW, I tried tensorflow_v1 and tensorflow_v2, both failed.




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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org