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: github.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":2},"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:9e6ea1ae-11f0-4d84-b1b9-936802526f91 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC68:99A39:489AE76:5FEB59D:6992E6E7 |
| html-safe-nonce | a040683e65efd28573058a60e433db71ab57fcb983ac9594e84cdf122a536da4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzY4Ojk5QTM5OjQ4OUFFNzY6NUZFQjU5RDo2OTkyRTZFNyIsInZpc2l0b3JfaWQiOiI3MDYyMjA0ODc4MjI0MDI1MzE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | df52ff15d6a2277f113a67e7d1280fd20e59db88707fc80d4f788f4e06d9c523 |
| 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/634a393050f463404dd228a6fbffc90d0d359af5f7f92bf2d70e02b5fd4ceefc/IntelPython/dpctl/issues/2230 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/634a393050f463404dd228a6fbffc90d0d359af5f7f92bf2d70e02b5fd4ceefc/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 | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| 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 | 84dcb133269e3cfe6e0296cc85fbacb92cae92bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width