()
| 106 | |
| 107 | |
| 108 | def test_data_ptr_tensor_cpu(): |
| 109 | arr = np.random.rand(3, 5, 6) |
| 110 | tensor = TensorCPU(arr, "HWC") |
| 111 | from_tensor = py_buffer_from_address( |
| 112 | tensor.data_ptr(), tensor.shape(), types.to_numpy_type(tensor.dtype) |
| 113 | ) |
| 114 | assert np.array_equal(arr, from_tensor) |
| 115 | |
| 116 | |
| 117 | def test_data_ptr_tensor_list_cpu(): |
nothing calls this directly
no test coverage detected