MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_data_ptr_tensor_cpu

Function test_data_ptr_tensor_cpu

dali/test/python/test_backend_impl.py:108–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106
107
108def 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
117def test_data_ptr_tensor_list_cpu():

Callers

nothing calls this directly

Calls 2

py_buffer_from_addressFunction · 0.90
shapeMethod · 0.45

Tested by

no test coverage detected