MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / test_tensor_wrap_cuda_array_interface

Function test_tensor_wrap_cuda_array_interface

tests/cvcuda/python/test_tensor.py:418–430  ·  view source on GitHub ↗
(shape_arg, dtype_arg, layout_arg)

Source from the content-addressed store, hash-verified

416 ],
417)
418def test_tensor_wrap_cuda_array_interface(shape_arg, dtype_arg, layout_arg):
419 tensor = cvcuda.Tensor(shape_arg, dtype_arg, layout_arg)
420
421 tcuda = tensor.cuda()
422 cai = tcuda.__cuda_array_interface__
423 assert cai["typestr"] == dtype_arg.str
424 assert cai["shape"] == shape_arg
425
426 wrapped = cvcuda.as_tensor(tcuda, layout_arg)
427
428 assert wrapped.shape == shape_arg
429 assert wrapped.dtype == dtype_arg
430 assert wrapped.layout == layout_arg
431
432
433def test_tensor_size_in_bytes():

Callers

nothing calls this directly

Calls 2

cudaMethod · 0.95
TensorMethod · 0.45

Tested by

no test coverage detected