Skip to content

Commit

Permalink
[TF] Support TensorFlow < 1.13 for test_sparse_add (#8647)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaolong18 authored Aug 15, 2021
1 parent 49224cb commit 1a95f9b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/python/frontend/tensorflow/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 1a95f9b

Please sign in to comment.