Skip to content

Commit

Permalink
Use numpy_cupy_array_equal instead of numpy_cupy_array_list_equal (
Browse files Browse the repository at this point in the history
…#3599)

* Use numpy_cupy_array_equal instead of numpy_cupy_array_list_equal

* Temporary fix for dtype compatibility
  • Loading branch information
asi1024 committed Jul 13, 2020
1 parent 16ca7bd commit 7f24cb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cupy/statistics/histogram.py
Expand Up @@ -236,6 +236,10 @@ def histogram(x, bins=10, range=None, weights=None, density=False):
bin_edges[-1] -= 1
elif x.dtype.kind == 'f':
bin_edges[-1] = old_edge

# TODO(asi1024): Refactor temporary fix for dtype compatibility
if isinstance(bins, cupy.ndarray):
bin_edges = bin_edges.astype(bins.dtype, copy=False)
break
else:
_histogram_kernel(x, bin_edges, bin_edges.size, y)
Expand Down
2 changes: 1 addition & 1 deletion tests/cupy_tests/statics_tests/test_histogram.py
Expand Up @@ -326,7 +326,7 @@ def tearDown(self):
_accelerator.set_routine_accelerators(self.old_accelerators)

@testing.for_all_dtypes(no_bool=True, no_complex=True)
@testing.numpy_cupy_array_list_equal()
@testing.numpy_cupy_array_equal()
def test_histogram(self, xp, dtype):
x = testing.shaped_arange((10,), xp, dtype)

Expand Down

0 comments on commit 7f24cb5

Please sign in to comment.