Suppose I have a sparse matrix
A = tf.sparse.SparseTensor(indices=[[0,0],[1,1],[1,2]], values=[1,1,1],
dense_shape=[2,3])
and a dense vector
B = tf.constant([4,3,5])
The shape of matrix A and vector B are (2,3), (1,3) respectively. I would like to element-wise multiply B with each row of A. The expected result is another sparse matrix, say
C = tf.sparse.SparseTensor(indices=[[0,0],[1,1],[1,2]], values=[4,3,5],
dense_shape=[2,3])
I know it would be relatively easy if A is a dense matrix, but the dense size of A is extremely large and most of the elements in A are zero.