This is an automated email from the ASF dual-hosted git repository.
junrushao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/main by this push:
new 1a95f9b [TF] Support TensorFlow < 1.13 for test_sparse_add (#8647)
1a95f9b is described below
commit 1a95f9bd0e84c4f3ebcbd668f26631fd74e8f28f
Author: xiaolong18 <[email protected]>
AuthorDate: Mon Aug 16 04:43:52 2021 +0800
[TF] Support TensorFlow < 1.13 for test_sparse_add (#8647)
---
tests/python/frontend/tensorflow/test_forward.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/python/frontend/tensorflow/test_forward.py
b/tests/python/frontend/tensorflow/test_forward.py
index 6733b32..51c2414 100644
--- a/tests/python/frontend/tensorflow/test_forward.py
+++ b/tests/python/frontend/tensorflow/test_forward.py
@@ -2511,9 +2511,15 @@ def _test_sparse_add(indices, values, A_shape, B_shape,
dtype, flip=False):
# TODO(ANSHUMAN87): support user input threashold values
if flip:
- result = tf.sparse.add(B, A_sp, threshold=0)
+ if package_version.parse(tf.VERSION) <
package_version.parse("1.13.0"):
+ result = tf.sparse.add(B, A_sp, thresh=0)
+ else:
+ result = tf.sparse.add(B, A_sp, threshold=0)
else:
- result = tf.sparse.add(A_sp, B, threshold=0)
+ if package_version.parse(tf.VERSION) <
package_version.parse("1.13.0"):
+ result = tf.sparse.add(A_sp, B, thresh=0)
+ else:
+ result = tf.sparse.add(A_sp, B, threshold=0)
B_np = np.random.uniform(high=5.0, size=B_shape).astype(dtype)