-
Notifications
You must be signed in to change notification settings - Fork 608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Python dtype conversion for int64 on Windows. #12880
Conversation
// See: | ||
// * https://numpy.org/doc/stable/reference/arrays.dtypes.html | ||
// * https://docs.python.org/3/c-api/arg.html#numbers | ||
// | ||
// Single letter codes can be ambiguous across platforms, so prefer explicit | ||
// bit depth values, ("Type strings: Any string in numpy.sctypeDict.keys()"). | ||
// See https://github.com/pybind/pybind11/issues/1908 | ||
const char* dtype_string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Eliasj42 , this is changing the same code as your #12872 (nice timing on that and @allieculp 's ping on the Windows issue!). I think adding a complex test case to runtime/bindings/python/tests/vm_types_test.py might be enough for your PR, but we should also add more e2e tests using complex to ensure it works across all the layers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Do we tests in place to fail if we regress? (I assume the test newly enabled on Windows)
Yeah, the newly enabled test covers this. We could still use some pure-python (no TF / other frameworks) tests that go through a more complete workflow with each data type though. |
Fixes #11080. The int64 and uint64 test cases here were failing on Windows as the element type mapping was routing via the code `l`, which is a "C long int" - not an explicitly 64 bit type. This changes the mapping to always use the explicit "type strings" (any string in `numpy.sctypeDict.keys()`, [shown in this gist](https://gist.github.com/ScottTodd/ec1f7906e9c644eb47f74280d6c26229)). Relates to #12872
Fixes iree-org#11080. The int64 and uint64 test cases here were failing on Windows as the element type mapping was routing via the code `l`, which is a "C long int" - not an explicitly 64 bit type. This changes the mapping to always use the explicit "type strings" (any string in `numpy.sctypeDict.keys()`, [shown in this gist](https://gist.github.com/ScottTodd/ec1f7906e9c644eb47f74280d6c26229)). Relates to iree-org#12872
Fixes #11080. The int64 and uint64 test cases here were failing on Windows as the element type mapping was routing via the code
l
, which is a "C long int" - not an explicitly 64 bit type. This changes the mapping to always use the explicit "type strings" (any string innumpy.sctypeDict.keys()
, shown in this gist).Relates to #12872