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 2020/05/05 05:20:49 UTC
[GitHub] [incubator-tvm] ANSHUMAN87 commented on a change in pull request #5510: [FRONTEND][TFLite] Fully connected op conversion made in sync with TFLite
ANSHUMAN87 commented on a change in pull request #5510:
URL: https://github.com/apache/incubator-tvm/pull/5510#discussion_r419869014
##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -1329,16 +1329,20 @@ def convert_fully_connected(self, op):
input_tensor_shape = input_tensor.tensor.ShapeAsNumpy()
weight_tensor_shape = weight_tensor.tensor.ShapeAsNumpy()
- # reshape input tensor from N H W C to N H*W*C
- input_size_per_batch = 1
- for s in range(1, len(input_tensor_shape)):
- input_size_per_batch *= input_tensor_shape[s]
- assert input_size_per_batch == weight_tensor_shape[1], \
- "input size and weight size are mismatched"
- target_shape = tuple((input_tensor_shape[0], input_size_per_batch))
Review comment:
@u99127 : This assert is wrong assumption, as it always assumes first dimension is the batch size, while it has utterly failed to link between the input and weights, which is highly dependent when you operate in Fully_Connected or Dense operator.
As the frontend is just a transformation of an successfully deployed model, so we can safely assume the valid relationship exists!
However this point will be evident when i put some comment to describe batch size computation as per your last comment. Thanks!
----------------------------------------------------------------
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