{"action":"created","issue":{"url":"https://api.github.com/repos/scipy/scipy/issues/5348","labels_url":"https://api.github.com/repos/scipy/scipy/issues/5348/labels{/name}","comments_url":"https://api.github.com/repos/scipy/scipy/issues/5348/comments","events_url":"https://api.github.com/repos/scipy/scipy/issues/5348/events","html_url":"https://github.com/scipy/scipy/issues/5348","id":110951939,"number":5348,"title":"wishlist: sparse in-place AXPY instead of deprecated sparsetools.csc_matvecs","user":{"login":"tmylk","id":1261528,"avatar_url":"https://avatars.githubusercontent.com/u/1261528?v=3","gravatar_id":"","url":"https://api.github.com/users/tmylk","html_url":"https://github.com/tmylk","followers_url":"https://api.github.com/users/tmylk/followers","following_url":"https://api.github.com/users/tmylk/following{/other_user}","gists_url":"https://api.github.com/users/tmylk/gists{/gist_id}","starred_url":"https://api.github.com/users/tmylk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmylk/subscriptions","organizations_url":"https://api.github.com/users/tmylk/orgs","repos_url":"https://api.github.com/users/tmylk/repos","events_url":"https://api.github.com/users/tmylk/events{/privacy}","received_events_url":"https://api.github.com/users/tmylk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scipy/scipy/labels/enhancement","name":"enhancement","color":"bfe5bf"},{"url":"https://api.github.com/repos/scipy/scipy/labels/scipy.sparse","name":"scipy.sparse","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-12T10:52:31Z","updated_at":"2015-10-12T20:16:11Z","closed_at":null,"body":"Our package [gensim](https://github.com/piskvorky/gensim/blob/28dfe050361a02ac38037e9f379e560bc3f03440/gensim/models/lsimodel.py#L659) depends on sparsetools.csc_matvecs which became internal  in https://github.com/scipy/scipy/pull/3440 and shows deprecation notices . \r\n\r\nsparsetools is used in gensim to save memory when corpus and chunk are large csc matrix and o is dense:\r\n\r\n```python\r\nsparsetools.csc_matvecs(m, n, samples, corpus.indptr, corpus.indices,\r\n                                corpus.data, o.ravel(), y.ravel())  # y = corpus * o\r\nsparsetools.csc_matvecs(m, n, samples, chunk.indptr, chunk.indices,  # y = y + chunk * o\r\n                                    chunk.data, o.ravel(), y.ravel())\r\n```\r\n\r\nIt would be great to have an externally available sparse in-place AXPY to replace the csc_matvecs which is about to get deprecated.\r\n\r\nThanks to Pauli Virtanen on the mailing list for the suggestion.\r\nhttps://mail.scipy.org/pipermail/scipy-user/2015-October/036712.html"},"comment":{"url":"https://api.github.com/repos/scipy/scipy/issues/comments/147508770","html_url":"https://github.com/scipy/scipy/issues/5348#issuecomment-147508770","issue_url":"https://api.github.com/repos/scipy/scipy/issues/5348","id":147508770,"user":{"login":"pv","id":35046,"avatar_url":"https://avatars.githubusercontent.com/u/35046?v=3","gravatar_id":"","url":"https://api.github.com/users/pv","html_url":"https://github.com/pv","followers_url":"https://api.github.com/users/pv/followers","following_url":"https://api.github.com/users/pv/following{/other_user}","gists_url":"https://api.github.com/users/pv/gists{/gist_id}","starred_url":"https://api.github.com/users/pv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pv/subscriptions","organizations_url":"https://api.github.com/users/pv/orgs","repos_url":"https://api.github.com/users/pv/repos","events_url":"https://api.github.com/users/pv/events{/privacy}","received_events_url":"https://api.github.com/users/pv/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T20:16:11Z","updated_at":"2015-10-12T20:16:11Z","body":"The GEMM interface probably would be most general reasonable:\r\n```\r\ndef scipy.sparse.inplace_dot(a, b, c, alpha=1, beta=0)\r\n   \"\"\"c = alpha * (a @ b) + beta * c, done in-place\"\"\"\r\n```\r\nI guess it should fail if given matrices for which it cannot perform the requested operation.\r\nProbably no need for gemm transpose options, since csr -> csc transpose is fast operation."}}