-
Notifications
You must be signed in to change notification settings - Fork 74.8k
Closed
Labels
TF 2.3Issues related to TF 2.3Issues related to TF 2.3comp:opsOPs related issuesOPs related issuestype:bugBugBug
Description
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac OS X 10.15
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): 2.1
- Python version: 3.8
Describe the current behavior
tf.debugging.assert_shapes
cannot be used with sparse tensors.
Describe the expected behavior
tf.debugging.assert_shapes
should allow you to mix and match dense and sparse tensors when checking for dimensional consistency.
Code to reproduce the issue
import tensorflow as tf
A = tf.range(3)
tf.debugging.assert_shapes(((A, [3]),)) # works
# raises "ValueError: Attempt to convert a value (...) with an unsupported type (<class 'tensorflow.python.framework.sparse_tensor.SparseTensor'>) to a Tensor.
tf.debugging.assert_shapes(((tf.sparse.from_dense(A), [3]),))
Metadata
Metadata
Assignees
Labels
TF 2.3Issues related to TF 2.3Issues related to TF 2.3comp:opsOPs related issuesOPs related issuestype:bugBugBug