()
| 482 | @requires_numpy_version("2.1.0") |
| 483 | @check_bytes_allocated |
| 484 | def test_from_dlpack_explicit_copy(): |
| 485 | expected = np.array([1, 2, 3], dtype=np.int64) |
| 486 | tensor = pa.Tensor.from_dlpack(expected, copy=True) |
| 487 | result = tensor.to_numpy() |
| 488 | expected[0] = 100 |
| 489 | # The data was copied, so mutating the source is not visible. |
| 490 | assert result[0] == 1 |
| 491 | |
| 492 | |
| 493 | def test_from_dlpack_no_dlpack_method(): |