dhruvaray commented on a change in pull request #5329:
[Relay][Frontend][TFLite] Add parser support for shape and range
URL: https://github.com/apache/incubator-tvm/pull/5329#discussion_r408574755
##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -579,6 +581,49 @@ def convert_tanh(self, op):
return out
+ def convert_range(self, op):
+ """Convert TFLite Range"""
+ try:
+ from tflite.Operator import Operator
+ except ImportError:
+ raise ImportError("The tflite package must be installed")
+
+ if self.is_quantized(op):
+ raise tvm.error.OpNotImplemented(
+ 'TFlite quantized RANGE operator is not supported yet.')
+
+ assert isinstance(op, Operator)
+ input_tensors = self.get_input_tensors(op)
+ assert len(input_tensors) == 3, "input tensors length should be 3"
+
+ start, limit, delta = self.get_expr(input_tensors[0].tensor_idx),\
+ self.get_expr(input_tensors[1].tensor_idx),\
+ self.get_expr(input_tensors[2].tensor_idx)
+
+
+ out = _op.arange(start, limit, delta, "int32")
Review comment:
@siju-samuel : Fixed and added extra test cases to demonstrate support for
other types. I inter the type though...
----------------------------------------------------------------
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