-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
Using `np.mgrid' depends on slice dtype
Reproducing code example:
import numpy as np
a = np.mgrid[[slice(np.float32(0.1), np.float32(0.3), np.float32(0.1)) for _ in range(1)]]
# returns array([[0, 0, 0]])
b = np.mgrid[[slice(np.float64(0.1), np.float64(0.3), np.float64(0.1)) for _ in range(1)]]
# returns array([[0.1, 0.2]])
np.testing.assert_allclose(a, b)Numpy/Python version information:
1.18.4 3.6.7 (default, Mar 27 2020, 15:56:09)
[GCC 6.5.0 20181026]
Reactions are currently unavailable