()
| 194 | @requires_numpy_version("2.1.0") |
| 195 | @check_bytes_allocated |
| 196 | def test_fixed_shape_tensor_scalar_dlpack(): |
| 197 | np_arr = np.arange(12, dtype=np.int32).reshape(3, 2, 2) |
| 198 | arr = pa.FixedShapeTensorArray.from_numpy_ndarray(np_arr) |
| 199 | |
| 200 | scalar = arr[1] |
| 201 | assert isinstance(scalar, pa.FixedShapeTensorScalar) |
| 202 | # __dlpack_device__ reads the storage array's device, without building a Tensor. |
| 203 | assert scalar.__dlpack_device__() == (1, 0) |
| 204 | |
| 205 | result = np.from_dlpack(DLPackForwarder(scalar, max_version=(1, 0))) |
| 206 | np.testing.assert_array_equal(result, np_arr[1], strict=True) |
| 207 | |
| 208 | |
| 209 | def multidim_arrays_with_nulls(): |
nothing calls this directly
no test coverage detected