Title: Encoding and manipulating N-dimensional tensors · Issue #534 · python-graphblas/python-graphblas · GitHub
Open Graph Title: Encoding and manipulating N-dimensional tensors · Issue #534 · python-graphblas/python-graphblas
X Title: Encoding and manipulating N-dimensional tensors · Issue #534 · python-graphblas/python-graphblas
Description: We have found that many applications want 3d arrays, and some may need arrays of even higher dimensions. This is typically handled by stacking arrays such that a single dimension of a GraphBLAS Matrix encodes multiple logical dimensions ...
Open Graph Description: We have found that many applications want 3d arrays, and some may need arrays of even higher dimensions. This is typically handled by stacking arrays such that a single dimension of a GraphBLAS Mat...
X Description: We have found that many applications want 3d arrays, and some may need arrays of even higher dimensions. This is typically handled by stacking arrays such that a single dimension of a GraphBLAS Mat...
Opengraph URL: https://github.com/python-graphblas/python-graphblas/issues/534
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Encoding and manipulating N-dimensional tensors","articleBody":"We have found that many applications want 3d arrays, and some may need arrays of even higher dimensions.\r\n\r\nThis is typically handled by _stacking_ arrays such that a single dimension of a GraphBLAS Matrix encodes multiple logical dimensions of a tensor. Performing operations between such objects often requires reorganizing the data so the logical axes align. This is awkward to do today. Can we make it easier?\r\n\r\nOne option is to add something like `np.moveaxis` (https://numpy.org/doc/stable/reference/generated/numpy.moveaxis.html). To make this general, I think we would need to include how the dimensinos of the logical tensor are encoded in Vector or Matrix dimensions, and then how to reorganize it. Some operations--particularly in 3D--can probably be optimized pretty well, and we should try to make things fast when possible.\r\n\r\nA quarter-baked proposal may look something like this: `A.reorganize(src_shape=((2, 3), (4,2)), dst_axes=((0, 1), (3, 2)))`. This effectively does a transpose by swapping the last two axes. It may be more natural at times to think in terms of source shape and source indices, or in terms of destination shape and indices (or some mix of the two). This has the potential of being confusing in general, but should hopefully make sense when you actually have data that you need to manipulate.\r\n\r\nHow far would such an operation go to making `python-graphblas` more usable for tensors? What else do we need for common use cases?","author":{"url":"https://github.com/eriknw","@type":"Person","name":"eriknw"},"datePublished":"2024-02-05T18:08:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/534/python-graphblas/issues/534"}
| 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:28886938-a39b-ef7f-ede4-97856a58b8c5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85C0:32F647:1D1718B:27E58FA:698DC553 |
| html-safe-nonce | 4d1c0da0061976e406f589189511d8a7eaf26b6e960cbe5f1c9eff88350725e0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUMwOjMyRjY0NzoxRDE3MThCOjI3RTU4RkE6Njk4REM1NTMiLCJ2aXNpdG9yX2lkIjoiOTA3ODU4MDg1Mjc2MjE5OTM3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0b407712e7864dd40a887a7bdd8550b916e8ec65e08a365d26c1a7601b76da2d |
| hovercard-subject-tag | issue:2119164952 |
| 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/python-graphblas/python-graphblas/534/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7049d8afef6a661fc915847927e1c0bd47076ed1fd48032b406d5049fd0627c0/python-graphblas/python-graphblas/issues/534 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7049d8afef6a661fc915847927e1c0bd47076ed1fd48032b406d5049fd0627c0/python-graphblas/python-graphblas/issues/534 |
| og:image:alt | We have found that many applications want 3d arrays, and some may need arrays of even higher dimensions. This is typically handled by stacking arrays such that a single dimension of a GraphBLAS Mat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | eriknw |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2457fd9a1b17ca7f38c3c2653895ccb2e0dd04f18f77446a21354e9bc4b7902f |
| turbo-cache-control | no-preview |
| go-import | github.com/python-graphblas/python-graphblas git https://github.com/python-graphblas/python-graphblas.git |
| octolytics-dimension-user_id | 103965858 |
| octolytics-dimension-user_login | python-graphblas |
| octolytics-dimension-repository_id | 221014819 |
| octolytics-dimension-repository_nwo | python-graphblas/python-graphblas |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 221014819 |
| octolytics-dimension-repository_network_root_nwo | python-graphblas/python-graphblas |
| 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 | 878672b82363fd98fbdc5bd0edb68e572c8a8d9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width