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

Function test_tensor_reshape_strided

tests/cvcuda/python/test_tensor.py:383–392  ·  view source on GitHub ↗
(shape_arg, layout_arg, expected_strides)

Source from the content-addressed store, hash-verified

381 ],
382)
383def test_tensor_reshape_strided(shape_arg, layout_arg, expected_strides):
384 tensor = cvcuda.Tensor((10, 10, 3), np.uint8, layout="HWC")
385 assert tensor.cuda().strides == (32, 3, 1) # strided rows
386
387 new_tensors = [
388 tensor.reshape(shape_arg, layout=layout_arg),
389 cvcuda.reshape(tensor, shape_arg, layout=layout_arg),
390 ]
391 for new_tensor in new_tensors:
392 assert new_tensor.cuda().strides == expected_strides
393
394
395@t.mark.parametrize(

Callers

nothing calls this directly

Calls 4

cudaMethod · 0.95
reshapeMethod · 0.95
TensorMethod · 0.45
cudaMethod · 0.45

Tested by

no test coverage detected