Skip to content

Clarify output dtype guidance for mean, var, and std #260

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

Merged
merged 3 commits into from
Sep 14, 2021

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Sep 13, 2021

This PR

  • clarifies output dtype guidance for mean, var, and std, as discussed in gh-202.

    Notably, the PR adds notes which clarify the output array dtype when the input array has an integer dtype. While integer dtypes are not explicitly supported by the standard (due to mixed-type promotion being undefined), this PR adds language to require that, if an array having an integer dtype is provided, the returned array must have the default floating-point dtype.

    For floating-point input arrays, the returned array must have the same dtype as the input array.

@kgryte kgryte added the bug Something isn't working. label Sep 13, 2021
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and should be uncontroversial, so merging. Thanks @kgryte

@rgommers rgommers merged commit 85d3170 into main Sep 14, 2021
@rgommers rgommers deleted the stat-reduction-dtypes branch September 14, 2021 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants