maheshambule commented on a change in pull request #5330: [Frontend][TFLite]
support for FILL and SPLIT_V operators
URL: https://github.com/apache/incubator-tvm/pull/5330#discussion_r408117717
##########
File path: tests/python/frontend/tflite/test_forward.py
##########
@@ -1105,6 +1112,37 @@ def test_forward_zeros_like():
""" ZEROS LIKE """
_test_zeros_like(np.arange(6.0, dtype=np.float32).reshape((1, 6)))
+
+#######################################################################
+# Fill
+# ----
+
+def _test_fill(dims, value_data, value_dtype):
+ """ Use the fill op to create a tensor of value_data with constant dims."""
+
+ value_data = np.array(value_data, dtype=value_dtype)
+ with tf.Graph().as_default():
+ value = array_ops.placeholder(dtype=value_dtype, name="value",
shape=[])
+ out = tf.fill(dims, value)
+ compare_tflite_with_tvm([value_data], ["value"], [value], [out])
+
+ with tf.Graph().as_default():
+ input1 = array_ops.placeholder(dtype=value_dtype, name="input1",
shape=dims)
+ # Fill op gets converted to static tensor during conversion
+ out = tf.fill(dims, value_data)
+ out1 = tf.add(out, input1)
+ input1_data = np.random.uniform(0, 5, size=dims).astype(value_dtype)
+ compare_tflite_with_tvm([input1_data], ["input1"], [input1], [out1])
+
+
+def test_forward_fill():
Review comment:
oh missed it! Thanks. Done.
----------------------------------------------------------------
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