mbaret commented on a change in pull request #6228:
URL: https://github.com/apache/incubator-tvm/pull/6228#discussion_r467972074



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -1695,10 +1695,9 @@ def convert_fully_connected(self, op):
             raise ImportError("The tflite package must be installed")
 
         input_tensors = self.get_input_tensors(op)
-        assert len(input_tensors) >= 2, "input tensors length should be >= 2"
+        assert len(input_tensors) in (2, 3), "input tensors length should be 
two or three"

Review comment:
       input_tensors can now have 3 elements, but I can't see the 3rd tensors 
(input_tensors[2]) being used anywhere?

##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -2456,25 +2456,27 @@ def test_forward_sparse_to_dense():
 # Fully Connected
 # ---------------
 
-def _test_fully_connected(tensor_in_sizes, filter_in_sizes, bias_in_size=None):
+def _test_fully_connected(tensor_in_sizes, wrap_input, filter_in_sizes, 
bias_in_size=None):
     """ One iteration of fully connected """
 
-    total_size_1 = 1
-    total_size_2 = 1
-    for s in tensor_in_sizes:
-        total_size_1 *= s
-    for s in filter_in_sizes:
-        total_size_2 *= s
-    # Initializes the input tensor with array containing incrementing
-    # numbers from 1.
-    data_array = [f * 1.0 for f in range(1, total_size_1 + 1)]
-    filter_array = [f * 1.0 for f in range(1, total_size_2 + 1)]
+    total_size_1 = np.prod( tensor_in_sizes )
+    total_size_2 = np.prod( filter_in_sizes )
+
     assert int(total_size_1 / tensor_in_sizes[0]) == filter_in_sizes[0], \
         "input size and filter size are mismatched"
 
+    # Initializes the input tensor with array containing incrementing
+    # numbers from 1.
+    data_array = np.arange(1, total_size_1 + 1, dtype=np.float32)
+    filter_array = np.arange(1, total_size_2 + 1, dtype=np.float32)
+
     with tf.Graph().as_default():
-        in_data = array_ops.placeholder(shape=tensor_in_sizes, dtype='float32')
-        in_filter = constant_op.constant(filter_array, shape=filter_in_sizes, 
dtype='float32')
+        in_name="input"

Review comment:
       ```suggestion
           in_name = "input"
   ```

##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -1720,7 +1719,7 @@ def convert_fully_connected(self, op):
         # Dense expected Weight shape: [out_dim, n_units]
         # Dense output shape: [batch_size, out_dim]
         target_shape = tuple((-1, weight_tensor_shape[1]))
-        in_expr = self.get_expr(input_tensor_idx)
+        in_expr = self.get_tensor_expr(input_tensor)

Review comment:
       Is this a related change?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to