René's URL Explorer Experiment


Title: Assignment of Expression to Tensor of Incorrect Dimensions - Strange Error - Numpy Unable to Allocate very Large Array · Issue #287 · xtensor-stack/xtensor-python · GitHub

Open Graph Title: Assignment of Expression to Tensor of Incorrect Dimensions - Strange Error - Numpy Unable to Allocate very Large Array · Issue #287 · xtensor-stack/xtensor-python

X Title: Assignment of Expression to Tensor of Incorrect Dimensions - Strange Error - Numpy Unable to Allocate very Large Array · Issue #287 · xtensor-stack/xtensor-python

Description: Version: name: SomeEnvironment channels: - https://conda.anaconda.org/conda-forge # Originally created on Ubuntu Jammy: dependencies: - numpy=1.24 - python=3.9 - xtensor-python=0.26.1 - xtensor-blas: Need to check, the machine in questio...

Open Graph Description: Version: name: SomeEnvironment channels: - https://conda.anaconda.org/conda-forge # Originally created on Ubuntu Jammy: dependencies: - numpy=1.24 - python=3.9 - xtensor-python=0.26.1 - xtensor-bla...

X Description: Version: name: SomeEnvironment channels: - https://conda.anaconda.org/conda-forge # Originally created on Ubuntu Jammy: dependencies: - numpy=1.24 - python=3.9 - xtensor-python=0.26.1 - xtensor-bla...

Opengraph URL: https://github.com/xtensor-stack/xtensor-python/issues/287

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assignment of Expression to Tensor of Incorrect Dimensions - Strange Error - Numpy Unable to Allocate very Large Array","articleBody":"Version:\r\n```\r\nname: SomeEnvironment\r\nchannels:\r\n  - https://conda.anaconda.org/conda-forge\r\n\r\n# Originally created on Ubuntu Jammy:\r\ndependencies:\r\n  - numpy=1.24\r\n  - python=3.9\r\n  - xtensor-python=0.26.1\r\n  - xtensor-blas: Need to check, the machine in question is down.\r\n```\r\n\r\n\r\n\r\nI spent a good few hours lost trying to dig out a bug that was leading to a segfault, and then an obscure message coming back from numpy about not being able to allocate enough space for an enormous array.\r\n\r\nIt turns out that I was simply assigning an expression that should have been a (1D) vector to a 2-dimensional pytensor. This one verifies my constant love of constraining dimension at compile-time! \"Let's just keep things simple\" they say, and then I waste time trying to debug code that never could have run correctly and without safety measures it's not so simple :sweat_smile: \r\n\r\nIn any case, we are at runtime and here is a MRE:\r\n```C++\r\nvoid debugEntryPoint(){\r\n    \r\n    \r\n    xt::pytensor\u003cstd::complex\u003cfloat\u003e, 2\u003e matrix{\r\n            {3, 0, 0, 0},\r\n            {0, 4, 0, 0},\r\n            {0, 0, 5, 0},\r\n            {0, 0, 0, 6}\r\n    };\r\n    xt::pytensor\u003cstd::complex\u003cfloat\u003e, 1\u003e vector{{0, 0, 0, 1}};\r\n\r\n\r\n    xt::pytensor\u003cstd::complex\u003cfloat\u003e, 1\u003e   correctResult = xt::linalg::dot(matrix, vector);\r\n    xt::pytensor\u003cstd::complex\u003cfloat\u003e, 2\u003e incorrectResult = xt::linalg::dot(matrix, vector);\r\n    // We never get here\r\n\r\n    cout \u003c\u003c correctResult \u003c\u003c endl;\r\n\r\n\r\n    // Or equally:\r\n    const auto \u0026view = xt::linalg::dot(matrix, vector);\r\n    xt::pytensor\u003cstd::complex\u003cfloat\u003e, 1\u003e   correctResult = view;\r\n    xt::pytensor\u003cstd::complex\u003cfloat\u003e, 2\u003e incorrectResult = view;\r\n    \r\n}\r\n```\r\n\r\nI would expect a message explaining that the size of the view as the result of the expression created cannot be assigned to a tensor of this shape. I.e. note that the error comes at the moment we assign, not when we try to compute the result.\r\nAnd the problem is that this is the error that results:\r\n\r\n```Python\r\n\u003e\u003e\u003e debugEntryPoint()\r\nnumpy.core._exceptions._ArrayMemoryError: Unable to allocate 3.98 PiB for an array with shape (4, 140095169944816) and data type complex64\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\r\nRuntimeError: NumPy: unable to create ndarray\r\n\r\n```\r\n\r\nNot sure if this is down to the BLAS or Python package, but opening here as it specifically relates to the message from Numpy and at the point we perform the copy.\r\n\r\nCheers","author":{"url":"https://github.com/stellarpower","@type":"Person","name":"stellarpower"},"datePublished":"2023-03-02T01:07:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/287/xtensor-python/issues/287"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5e301294-14a7-e89a-53ad-2d5420f3fdac
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE480:287BC8:97E9F7:D04094:696FED86
html-safe-nonce353e15d63d30711806f894316e86219ca216824d0ee0c30551e95049186d6e9f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDgwOjI4N0JDODo5N0U5Rjc6RDA0MDk0OjY5NkZFRDg2IiwidmlzaXRvcl9pZCI6IjQzMTQxNDA4OTUwNjY3MTM0NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac44a9ea7f25cc093c272a962b85ffa4b0b271db680e2b2599f2e4a68851a27865
hovercard-subject-tagissue:1605943920
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/xtensor-stack/xtensor-python/287/issue_layout
twitter:imagehttps://opengraph.githubassets.com/4d59656bf0e2f98b19c97ae51fa702fe0ced1d432404fd357cbaa82c042166fa/xtensor-stack/xtensor-python/issues/287
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/4d59656bf0e2f98b19c97ae51fa702fe0ced1d432404fd357cbaa82c042166fa/xtensor-stack/xtensor-python/issues/287
og:image:altVersion: name: SomeEnvironment channels: - https://conda.anaconda.org/conda-forge # Originally created on Ubuntu Jammy: dependencies: - numpy=1.24 - python=3.9 - xtensor-python=0.26.1 - xtensor-bla...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamestellarpower
hostnamegithub.com
expected-hostnamegithub.com
None2b218dbdee134592a2dbfabd454a1070986f1fbedb8334bf06b8f2ccc3449130
turbo-cache-controlno-preview
go-importgithub.com/xtensor-stack/xtensor-python git https://github.com/xtensor-stack/xtensor-python.git
octolytics-dimension-user_id56542697
octolytics-dimension-user_loginxtensor-stack
octolytics-dimension-repository_id73431892
octolytics-dimension-repository_nwoxtensor-stack/xtensor-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id73431892
octolytics-dimension-repository_network_root_nwoxtensor-stack/xtensor-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebcaac379a58a3ed99a1b0502e2a8f5cfd3a7b54b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues/287#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fxtensor-stack%2Fxtensor-python%2Fissues%2F287
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fxtensor-stack%2Fxtensor-python%2Fissues%2F287
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=xtensor-stack%2Fxtensor-python
Reloadhttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues/287
Reloadhttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues/287
Reloadhttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues/287
xtensor-stack https://patch-diff.githubusercontent.com/xtensor-stack
xtensor-pythonhttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fxtensor-stack%2Fxtensor-python
Fork 67 https://patch-diff.githubusercontent.com/login?return_to=%2Fxtensor-stack%2Fxtensor-python
Star 364 https://patch-diff.githubusercontent.com/login?return_to=%2Fxtensor-stack%2Fxtensor-python
Code https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python
Issues 38 https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues
Pull requests 6 https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/pulls
Actions https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/actions
Projects 0 https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/security
Please reload this pagehttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues/287
Insights https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/pulse
Code https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python
Issues https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues
Pull requests https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/pulls
Actions https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/actions
Projects https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/projects
Security https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/security
Insights https://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/xtensor-stack/xtensor-python/issues/287
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/xtensor-stack/xtensor-python/issues/287
Assignment of Expression to Tensor of Incorrect Dimensions - Strange Error - Numpy Unable to Allocate very Large Arrayhttps://patch-diff.githubusercontent.com/xtensor-stack/xtensor-python/issues/287#top
https://github.com/stellarpower
https://github.com/stellarpower
stellarpowerhttps://github.com/stellarpower
on Mar 2, 2023https://github.com/xtensor-stack/xtensor-python/issues/287#issue-1605943920
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.