Title: Inconsistent DirectSolver interface. · Issue #53 · NVIDIA/nvmath-python · GitHub
Open Graph Title: Inconsistent DirectSolver interface. · Issue #53 · NVIDIA/nvmath-python
X Title: Inconsistent DirectSolver interface. · Issue #53 · NVIDIA/nvmath-python
Description: Hi everyone! I've noticed a small inconsistency in the sparse solver interface, namely when it comes to using it with a 2D tensor where the last dimension is 1. Given a 3x3 lhs sparse matrix and a 3x2 rhs dense matrix: a = torch.sparse_c...
Open Graph Description: Hi everyone! I've noticed a small inconsistency in the sparse solver interface, namely when it comes to using it with a 2D tensor where the last dimension is 1. Given a 3x3 lhs sparse matrix and a ...
X Description: Hi everyone! I've noticed a small inconsistency in the sparse solver interface, namely when it comes to using it with a 2D tensor where the last dimension is 1. Given a 3x3 lhs sparse matrix an...
Opengraph URL: https://github.com/NVIDIA/nvmath-python/issues/53
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inconsistent DirectSolver interface.","articleBody":"Hi everyone! I've noticed a small inconsistency in the sparse solver interface, namely when it comes to using it with a 2D tensor where the last dimension is 1.\n\nGiven a 3x3 lhs sparse matrix and a 3x2 rhs dense matrix:\n```\na = torch.sparse_coo_tensor([[0, 1, 2], [0, 1, 2]], [1.0, 1.0, 1.0], device=\"cuda\").to_sparse_csr()\nb = torch.randn([3, 2], device=\"cuda\")\n```\nwe can set up a solver for with:\n```\nnvsparse.DirectSolver(a, b.mT.contiguous().mT)\n```\nThis works fine. However, for a 3x1 rhs:\n```\nb = torch.randn([3,1], device=\"cuda\")\n```\nsetting up the solver in the same way breaks with:\n\n```\nTypeError(\"The RHS tensor([[1.],\\n [1.],\\n [1.]], device='cuda:0') must be a matrix or vector with col-major layout, and for implicitly-batched RHS (N-D \u003e= 3), each matrix sample must have col-major layout (the second dimension from the end must have unit stride.\")\n```\n\nIt would be great not to have to special-case this.\n\nBest,\nAna\n","author":{"url":"https://github.com/anadodik","@type":"Person","name":"anadodik"},"datePublished":"2026-01-15T16:04:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/53/nvmath-python/issues/53"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:13382662-733b-2fe8-bd00-add630cf4966 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D36:29CC9A:39DBF:4BA60:6A61563C |
| html-safe-nonce | c0af45ca03f671c7c82f154f50d5490710024f676ad89f62071c0928eebe75cb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDM2OjI5Q0M5QTozOURCRjo0QkE2MDo2QTYxNTYzQyIsInZpc2l0b3JfaWQiOiIyNDY2MTI0MzIyODMyNDcxNjEyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 036bacfd6e8ac8cf8a059b5b560c7183f6df432679630d699736a32e5f0f3c67 |
| hovercard-subject-tag | issue:3818172459 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NVIDIA/nvmath-python/53/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e57892caa8162f446293478316a344dfa1b4e9f6e383c31fe28ddae2c07a3159/NVIDIA/nvmath-python/issues/53 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e57892caa8162f446293478316a344dfa1b4e9f6e383c31fe28ddae2c07a3159/NVIDIA/nvmath-python/issues/53 |
| og:image:alt | Hi everyone! I've noticed a small inconsistency in the sparse solver interface, namely when it comes to using it with a 2D tensor where the last dimension is 1. Given a 3x3 lhs sparse matrix and a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anadodik |
| hostname | github.com |
| expected-hostname | github.com |
| None | c258d2b06b498220e3b94af28b26bbbf58f4203a6373725f779afcc867afd263 |
| turbo-cache-control | no-preview |
| go-import | github.com/NVIDIA/nvmath-python git https://github.com/NVIDIA/nvmath-python.git |
| octolytics-dimension-user_id | 1728152 |
| octolytics-dimension-user_login | NVIDIA |
| octolytics-dimension-repository_id | 788208729 |
| octolytics-dimension-repository_nwo | NVIDIA/nvmath-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 788208729 |
| octolytics-dimension-repository_network_root_nwo | NVIDIA/nvmath-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bae60047c72c7890f36d34d78461f3453c546ee2 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width