Title: `dpt.astype` behaves differently on Windows depending on type of input array · Issue #2230 · IntelPython/dpctl · GitHub
Open Graph Title: `dpt.astype` behaves differently on Windows depending on type of input array · Issue #2230 · IntelPython/dpctl
X Title: `dpt.astype` behaves differently on Windows depending on type of input array · Issue #2230 · IntelPython/dpctl
Description: There is a suspicious behavior I faced on Windows (LNL with fp64 support for GPU): import dpctl, dpctl.tensor as dpt, numpy as np dpctl.__version__ # Out: '0.22.0dev0+117.g7960513f68' # for integer input the result is expected a = dpt.as...
Open Graph Description: There is a suspicious behavior I faced on Windows (LNL with fp64 support for GPU): import dpctl, dpctl.tensor as dpt, numpy as np dpctl.__version__ # Out: '0.22.0dev0+117.g7960513f68' # for integer...
X Description: There is a suspicious behavior I faced on Windows (LNL with fp64 support for GPU): import dpctl, dpctl.tensor as dpt, numpy as np dpctl.__version__ # Out: '0.22.0dev0+117.g7960513f68' # for...
Opengraph URL: https://github.com/IntelPython/dpctl/issues/2230
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`dpt.astype` behaves differently on Windows depending on type of input array","articleBody":"There is a suspicious behavior I faced on Windows (LNL with fp64 support for GPU):\n```python\nimport dpctl, dpctl.tensor as dpt, numpy as np\n\ndpctl.__version__\n# Out: '0.22.0dev0+117.g7960513f68'\n\n# for integer input the result is expected\na = dpt.asarray([160, 120])\ndpt.astype(a, dpt.uint8)\n# Out: usm_ndarray([160, 120], dtype=uint8)\n\n# for float32 the result seems incorrect:\na = dpt.asarray([160., 120.], dtype='f4')\ndpt.astype(a, dpt.uint8)\n# Out: usm_ndarray([127, 120], dtype=uint8)\n\n# but with float64 works as expected:\na = dpt.asarray([160., 120.], dtype='f8')\ndpt.astype(a, dpt.uint8)\n# Out: usm_ndarray([160, 120], dtype=uint8)\n\n# NumPy returns the same result in both cases:\n\na = np.asarray([160, 120])\nnp.astype(a, dpt.uint8)\n# Out: array([160, 120], dtype=uint8)\n\na = np.asarray([160., 120.], dtype='f4')\nnp.astype(a, dpt.uint8)\n# Out: array([160, 120], dtype=uint8)\n\n# for CPU device the result is the same as for NumPy:\n\na = dpt.asarray([160., 120.], dtype='i4', device='cpu')\ndpt.astype(a, dpt.uint8)\n# Out: usm_ndarray([160, 120], dtype=uint8)\n```\n\nI wonder if there is any limitation for float32 dtype or an issue.\n","author":{"url":"https://github.com/antonwolfy","@type":"Person","name":"antonwolfy"},"datePublished":"2026-01-15T14:41:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2230/dpctl/issues/2230"}
| 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:4cca053a-298d-9e07-eb4b-161421b04df4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA66:2FA0C8:1CCEB68:26DE477:696EB873 |
| html-safe-nonce | 8763d30a96d5fb352ff4bc481d588e867fa39ca0fb16c47dd7b3056139a33dbc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTY2OjJGQTBDODoxQ0NFQjY4OjI2REU0Nzc6Njk2RUI4NzMiLCJ2aXNpdG9yX2lkIjoiNzI0MDUwMjM4ODE1NjQ0NjgzNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 779dee90397b0583a0bbee7005bc20747c259c56756afc50e05c9e0349623454 |
| hovercard-subject-tag | issue:3817848111 |
| 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/IntelPython/dpctl/2230/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3b2111afc29e105ae236fe9d8e1b1b492abfdc9506277a03fc9061336a9a8997/IntelPython/dpctl/issues/2230 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3b2111afc29e105ae236fe9d8e1b1b492abfdc9506277a03fc9061336a9a8997/IntelPython/dpctl/issues/2230 |
| og:image:alt | There is a suspicious behavior I faced on Windows (LNL with fp64 support for GPU): import dpctl, dpctl.tensor as dpt, numpy as np dpctl.__version__ # Out: '0.22.0dev0+117.g7960513f68' # for integer... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | antonwolfy |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/IntelPython/dpctl git https://github.com/IntelPython/dpctl.git |
| octolytics-dimension-user_id | 20491374 |
| octolytics-dimension-user_login | IntelPython |
| octolytics-dimension-repository_id | 279842328 |
| octolytics-dimension-repository_nwo | IntelPython/dpctl |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 279842328 |
| octolytics-dimension-repository_network_root_nwo | IntelPython/dpctl |
| 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 | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width