Skip to content

Commit

Permalink
Don't cast histogram to int64 when density=True (#1042)
Browse files Browse the repository at this point in the history
  • Loading branch information
manopapad authored Sep 6, 2023
1 parent 8dddd18 commit f014105
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cunumeric/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -7910,7 +7910,7 @@ def histogram(
--------
Multiple GPUs, Multiple CPUs
"""
result_type = np.dtype(np.int64)
result_type: np.dtype[Any] = np.dtype(np.int64)

if np.ndim(bins) > 1:
raise ValueError("`bins` must be 1d, when an array")
Expand Down Expand Up @@ -7996,6 +7996,7 @@ def histogram(
# handle (density = True):
#
if density:
result_type = np.dtype(np.float64)
hist /= sum(hist)
hist /= bins_array[1:] - bins_array[:-1]

Expand Down

0 comments on commit f014105

Please sign in to comment.