-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sparse matrix multiplication? #1241
Comments
This was recently added. See sparse_ops.sparse_tensor_dense_matmul. The first input should be a 2-D SparseTensor and the second a regular dense tensor (matrix) of the same dtype. Backprop coming soon (at least into the dense tensor, no backprop into the SparseTensor is currently planned). |
I'm closing this issue unless there's missing functionality in the op I mentioned. |
Use sparse_ops.sparse_tensor_dense_matmul. Does this do what you need? |
Woah awesome! Thanks @ebrevdo . Had no idea this recently made it in. I think this will fit what I need, and will try this out tomorrow. |
I don't think this is sufficient to close this issue. The stackoverflow post is talking about the general case where you want something like I currently have that problem: I want to calculate a graph Laplacian given a sparse oriented edge matrix, D. Every row is an edge between two nodes, with -1 for node_i and 1 for node_j; the graph Laplacian is then (D'.D). My graph in this case has something like a million nodes but only about 3 million edges, so the overall sparse D representation has about 6 million entries. This is a piece of cake to calculate using something like scipy's sparse matrix multiplication, but converting it to tensorflow requires creating a dense 1M x 1M matrix. |
Feel free to open a new issue asking specifically for (SparseTensor, SparseTensor) matmul. |
I also have similar problem to @tansey. |
I also need sparse@sparse matrix multiplication. Even with a_is_sparse and b_is_sparse set to true TF still load n^2 dense matrices into memory. it seems possible theoretically but I am unsure, are there any updates pertaining to this? Thanks. |
Hi There,
Is there currently support for sparse matrix multiplication in tensorflow?
I found this post:
http://stackoverflow.com/questions/34030140/is-sparse-tensor-multiplication-implemented-in-tensorflow
But it seems to indicate that one must first convert the sparse matrix into a dense matrix before running the multiplication.
The text was updated successfully, but these errors were encountered: