| 2238 | |
| 2239 | @pytest.mark.parametrize('dt', ['uint8', int, float, complex]) |
| 2240 | def test_round_copies(self, dt): |
| 2241 | a = np.arange(3, dtype=dt) |
| 2242 | assert not np.shares_memory(a.round(), a) |
| 2243 | assert not np.shares_memory(a.round(decimals=2), a) |
| 2244 | |
| 2245 | out = np.empty(3, dtype=dt) |
| 2246 | assert not np.shares_memory(a.round(out=out), a) |
| 2247 | |
| 2248 | a = np.arange(12).astype(dt).reshape(3, 4).T |
| 2249 | |
| 2250 | assert a.flags.f_contiguous |
| 2251 | assert np.round(a).flags.f_contiguous |
| 2252 | |
| 2253 | def test_squeeze(self): |
| 2254 | a = np.array([[[1], [2], [3]]]) |