()
| 55 | |
| 56 | |
| 57 | def test_data_ptr_tensor_gpu(): |
| 58 | arr = np.random.rand(3, 5, 6) |
| 59 | pipe = ExternalSourcePipe(arr.shape[0], arr) |
| 60 | tensor = pipe.run()[0][0] |
| 61 | from_tensor = py_buffer_from_address( |
| 62 | tensor.data_ptr(), tensor.shape(), types.to_numpy_type(tensor.dtype), gpu=True |
| 63 | ) |
| 64 | # from_tensor is cupy array, convert arr to cupy as well |
| 65 | assert cp.allclose(arr[0], from_tensor) |
| 66 | |
| 67 | |
| 68 | def test_data_ptr_tensor_list_gpu(): |
nothing calls this directly
no test coverage detected