-
Notifications
You must be signed in to change notification settings - Fork 22
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
Histogram2d #2262
base: master
Are you sure you want to change the base?
Histogram2d #2262
Conversation
8cfd5db
to
541e7d9
Compare
541e7d9
to
58dbab3
Compare
58dbab3
to
a692ff5
Compare
@antonwolfy @vlad-perevezentsev ready for review |
@antonwolfy please re-review |
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.
I left one minor comment, but overall LGTM! Thank you @AlexanderKalistratov
Co-authored-by: Anton <[email protected]>
Array API standard conformance tests for dpnp=0.17.0dev4=py312he4f9c94_24 ran successfully. |
@@ -54,6 +54,19 @@ def to_supported_dtypes(dtypes, supported_types, device): | |||
def is_castable(dtype, stype): | |||
return _can_cast(dtype, stype, has_fp16, has_fp64) | |||
|
|||
if not isinstance(supported_types, Iterable): | |||
supported_types = (supported_types,) |
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.
It seems missing to be covered by a test
if isinstance(dtypes, Iterable): | ||
sdtypes_elem = supported_types[0] | ||
if not isinstance(sdtypes_elem, Iterable): | ||
raise ValueError( |
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.
And that error case as well
Implementation of
histogram2d
via already existing functionality ofhistogramdd
.histogram2d
accepts 2 different arrays, whilehistogramdd
accepts single two-dimensional array.In order to avoid double copy (first to single array, second to supported type)
histogram2d
perform type checks before calling tohistogramdd
.