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_r408574233
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -650,6 +693,51 @@ def test_all_resize():
_test_resize(tf.image.resize_nearest_neighbor, data,
align_corners=False)
+#######################################################################
+# Range
+# -------------
+def test_range():
+ # tflite 1.13 convert method does not accept empty shapes
+ if package_version.parse(tf.VERSION) >= package_version.parse('1.14.0'):
+ tf.reset_default_graph()
+ with tf.Graph().as_default():
+ data = np.array([1, 18, 3], dtype=np.int32)
+ start = tf.placeholder(dtype=tf.int32, shape=(), name="start")
+ limit = tf.placeholder(dtype=tf.int32, shape=(), name="limit")
+ delta = tf.placeholder(dtype=tf.int32, shape=(), name="delta")
+ out = tf.range(start, limit, delta, tf.int32, name="range")
+ compare_tflite_with_tvm(
+ [x for x in np.nditer(data)],
+ ["start", "limit", "delta"],
+ [start,limit,delta],
+ [out],
+ mode="vm",
+ quantized=False
+ )
+#######################################################################
+# Shape
+# -------------
Review comment:
Fixed...
----------------------------------------------------------------
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