mbaret commented on a change in pull request #5474:
URL: https://github.com/apache/incubator-tvm/pull/5474#discussion_r417873031
##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -863,6 +845,21 @@ def convert_add(self, op):
return self._convert_elemwise(_qnn.op.add, op)
return self._convert_elemwise(_op.add, op)
+ def convert_add_n(self, op):
+ """Convert TFLite ADD_N"""
+ output_tensors = self.get_output_tensors(op)
+ assert len(output_tensors) == 1, "output tensors length should be 1"
+
+ input_tensors = self.get_input_tensors(op)
+ assert not input_tensors[0].qnn_params, "TFLite does not support
quantized ADD_N."
+ lhs_expr = self.get_tensor_or_const_expr(input_tensors[0])
+ for rhs_tensor in input_tensors[1:]:
Review comment:
I believe doing x[1:] with len(x) < 2 will just return an empty list
rather than throw an error.
----------------------------------------------------------------
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]