René's URL Explorer Experiment


Title: Bug in `asnumpy` copy_utils · Issue #2138 · IntelPython/dpctl · GitHub

Open Graph Title: Bug in `asnumpy` copy_utils · Issue #2138 · IntelPython/dpctl

X Title: Bug in `asnumpy` copy_utils · Issue #2138 · IntelPython/dpctl

Description: It looks like the order-C is being ignored and the C-contiguous checks fails when using dpnp.asnumpy(). Please refer to the below reproducer and output with dpnp+dpctl & cupy, more specifically 3c section of the output. Upon a quick peek...

Open Graph Description: It looks like the order-C is being ignored and the C-contiguous checks fails when using dpnp.asnumpy(). Please refer to the below reproducer and output with dpnp+dpctl & cupy, more specifically 3c ...

X Description: It looks like the order-C is being ignored and the C-contiguous checks fails when using dpnp.asnumpy(). Please refer to the below reproducer and output with dpnp+dpctl & cupy, more specifically...

Opengraph URL: https://github.com/IntelPython/dpctl/issues/2138

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug in `asnumpy` copy_utils","articleBody":"It looks like the order-C is being ignored and the C-contiguous checks fails when using `dpnp.asnumpy()`. Please refer to the below reproducer and output with dpnp+dpctl \u0026 cupy, more specifically `3c` section of the output.\n\nUpon a quick peek, much of the `asnumpy` is being forwarded to `dpt.__copy_utils__` and so opened an issue here. Apologies if this is not the right repo and should move it to DPNP.\n\nReproducer:\n```python\nimport numpy as np\nimport dpnp as dp\n\nprint(\"dpnp version:\", getattr(dp, \"__version__\", \"unknown\"))\n\n# Build the same data as in the larger code\nctr_offsets_slice = [\n    dp.array([0, 0, 0], dtype=np.int32),\n    dp.array([3, 3, 3], dtype=np.int32),\n    dp.array([5, 5, 5], dtype=np.int32),\n    dp.array([7, 7, 7], dtype=np.int32),\n    dp.array([10, 10, 10], dtype=np.int32),\n    dp.array([11, 11, 11], dtype=np.int32),\n    dp.array([12, 12, 12], dtype=np.int32),\n]\n\n# 3a: stack -\u003e dpnp_array (should be C-contiguous)\ntemp1 = dp.stack(ctr_offsets_slice)\n\n# 3b: transpose -\u003e dpnp_array view (not C-contiguous)\ntemp2 = dp.stack(ctr_offsets_slice).T\n\n# 3c: device-\u003ehost with \"order='C'\"\n# EXPECTED (per docstring \"works exactly like numpy.asarray\"): C-contiguous NumPy array\n# ACTUAL: order is ignored for dpnp_array, result keeps non-C layout\ntemp3 = dp.asnumpy(temp2, order='C')\n\nprint(\"3a. Testing : temp1: \", bool(temp1.flags['C_CONTIGUOUS']), type(temp1), len(temp1), temp1)\nprint(\"3b. Testing : temp2: \", bool(temp2.flags['C_CONTIGUOUS']), type(temp2), len(temp2), temp2)\nprint(\"3c. Testing : temp3: \", bool(temp3.flags['C_CONTIGUOUS']), type(temp3), len(temp3), temp3)\n\n# Programmatic check to make the failure obvious:\nif not temp3.flags['C_CONTIGUOUS']:\n    print(\"\\nBUG: dpnp.asnumpy(dpnp_array, order='C') returned a non-C-contiguous NumPy array.\")\n    print(\"     strides:\", temp3.strides, \"| shape:\", temp3.shape)\n\n```\n \nOutput from DPNP+DPCTL:\n```bash\ndpnp version: 0.19.0dev3+8.gac795ab9.dirty\n3a. Testing : temp1:  True \u003cclass 'dpnp.dpnp_array.dpnp_array'\u003e 7 [[ 0  0  0]\n [ 3  3  3]\n [ 5  5  5]\n [ 7  7  7]\n [10 10 10]\n [11 11 11]\n [12 12 12]]\n3b. Testing : temp2:  False \u003cclass 'dpnp.dpnp_array.dpnp_array'\u003e 3 [[ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]]\n3c. Testing : temp3:  False \u003cclass 'numpy.ndarray'\u003e 3 [[ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]]\n\nBUG: dpnp.asnumpy(dpnp_array, order='C') returned a non-C-contiguous NumPy array.\n     strides: (4, 12) | shape: (3, 7)\n```\n\nOutput from CUPY\n```bash\ncupy version: 13.4.1\n3a. Testing : temp1:  True \u003cclass 'cupy.ndarray'\u003e 7 [[ 0  0  0]\n [ 3  3  3]\n [ 5  5  5]\n [ 7  7  7]\n [10 10 10]\n [11 11 11]\n [12 12 12]]\n3b. Testing : temp2:  False \u003cclass 'cupy.ndarray'\u003e 3 [[ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]]\n3c. Testing : temp3:  True \u003cclass 'numpy.ndarray'\u003e 3 [[ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]\n [ 0  3  5  7 10 11 12]]\n```","author":{"url":"https://github.com/abagusetty","@type":"Person","name":"abagusetty"},"datePublished":"2025-08-25T15:43:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/2138/dpctl/issues/2138"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ca94e5cc-26bb-126d-522f-e54e8cadcdef
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDB40:6A3DD:128C3D5C:12EEF6B3:696E9900
html-safe-noncead650db2bcd886ed8d11b78199aec1b097fa2deb9529d1d4829ff45581b5ae49
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjQwOjZBM0REOjEyOEMzRDVDOjEyRUVGNkIzOjY5NkU5OTAwIiwidmlzaXRvcl9pZCI6IjE3MTczMzYwMDQ5OTAyNDUxMjAiLCJyZWdpb25fZWRnZSI6InNlYSIsInJlZ2lvbl9yZW5kZXIiOiJzZWEifQ==
visitor-hmac2f85670c98a109cae0c9fb0c12afe14a6c992cc04fe1f32a1f68b1c1049e8347
hovercard-subject-tagissue:3352330594
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/IntelPython/dpctl/2138/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7108a824296e04df1f724d4aae500b1abd1afd317230a713f17d11cb741af85e/IntelPython/dpctl/issues/2138
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7108a824296e04df1f724d4aae500b1abd1afd317230a713f17d11cb741af85e/IntelPython/dpctl/issues/2138
og:image:altIt looks like the order-C is being ignored and the C-contiguous checks fails when using dpnp.asnumpy(). Please refer to the below reproducer and output with dpnp+dpctl & cupy, more specifically 3c ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameabagusetty
hostnamegithub.com
expected-hostnamegithub.com
Nonefdad15fd2ad43212aa8b8be5f2c2725550f8374ceeeb154a999ad9145b43f3f7
turbo-cache-controlno-preview
go-importgithub.com/IntelPython/dpctl git https://github.com/IntelPython/dpctl.git
octolytics-dimension-user_id20491374
octolytics-dimension-user_loginIntelPython
octolytics-dimension-repository_id279842328
octolytics-dimension-repository_nwoIntelPython/dpctl
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id279842328
octolytics-dimension-repository_network_root_nwoIntelPython/dpctl
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
release27b23bc056eb973d350fc95afc848757edb9e7a9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/IntelPython/dpctl/issues/2138#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FIntelPython%2Fdpctl%2Fissues%2F2138
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%2FIntelPython%2Fdpctl%2Fissues%2F2138
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=IntelPython%2Fdpctl
Reloadhttps://patch-diff.githubusercontent.com/IntelPython/dpctl/issues/2138
Reloadhttps://patch-diff.githubusercontent.com/IntelPython/dpctl/issues/2138
Reloadhttps://patch-diff.githubusercontent.com/IntelPython/dpctl/issues/2138
IntelPython https://patch-diff.githubusercontent.com/IntelPython
dpctlhttps://patch-diff.githubusercontent.com/IntelPython/dpctl
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FIntelPython%2Fdpctl
Fork 32 https://patch-diff.githubusercontent.com/login?return_to=%2FIntelPython%2Fdpctl
Star 121 https://patch-diff.githubusercontent.com/login?return_to=%2FIntelPython%2Fdpctl
Code https://patch-diff.githubusercontent.com/IntelPython/dpctl
Issues 51 https://patch-diff.githubusercontent.com/IntelPython/dpctl/issues
Pull requests 10 https://patch-diff.githubusercontent.com/IntelPython/dpctl/pulls
Discussions https://patch-diff.githubusercontent.com/IntelPython/dpctl/discussions
Actions https://patch-diff.githubusercontent.com/IntelPython/dpctl/actions
Projects 0 https://patch-diff.githubusercontent.com/IntelPython/dpctl/projects
Wiki https://patch-diff.githubusercontent.com/IntelPython/dpctl/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/IntelPython/dpctl/security
Please reload this pagehttps://patch-diff.githubusercontent.com/IntelPython/dpctl/issues/2138
Insights https://patch-diff.githubusercontent.com/IntelPython/dpctl/pulse
Code https://patch-diff.githubusercontent.com/IntelPython/dpctl
Issues https://patch-diff.githubusercontent.com/IntelPython/dpctl/issues
Pull requests https://patch-diff.githubusercontent.com/IntelPython/dpctl/pulls
Discussions https://patch-diff.githubusercontent.com/IntelPython/dpctl/discussions
Actions https://patch-diff.githubusercontent.com/IntelPython/dpctl/actions
Projects https://patch-diff.githubusercontent.com/IntelPython/dpctl/projects
Wiki https://patch-diff.githubusercontent.com/IntelPython/dpctl/wiki
Security https://patch-diff.githubusercontent.com/IntelPython/dpctl/security
Insights https://patch-diff.githubusercontent.com/IntelPython/dpctl/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/IntelPython/dpctl/issues/2138
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/IntelPython/dpctl/issues/2138
Bug in asnumpy copy_utilshttps://patch-diff.githubusercontent.com/IntelPython/dpctl/issues/2138#top
enhancementNew feature or requesthttps://github.com/IntelPython/dpctl/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/abagusetty
https://github.com/abagusetty
abagusettyhttps://github.com/abagusetty
on Aug 25, 2025https://github.com/IntelPython/dpctl/issues/2138#issue-3352330594
enhancementNew feature or requesthttps://github.com/IntelPython/dpctl/issues?q=state%3Aopen%20label%3A%22enhancement%22
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.