If I want to get the shape of a normal tensor in tensorflow, and store the values in a list, I would use the following
a_shape=[a.shape[0].value , a.shape[1].value]
If I'm not mistaken, using .value converts the element in the tensor to a real number.
With sparse tensors, I type the following
a_sparse_shape=[a.dense_shape[0].value, a.dense_shape[1].value]
However, I get the error message " 'Tensor' object has no attribute 'value' "
Does anyone have any alternate solutions?
a.shape
can also run normally with sparse tensors onversion=1.13
. - giser_yugang