Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] How to Convert a CV-CUDA Tensor to numpy array and pycuda tensor without torch.as_tensor #143

Open
laugh12321 opened this issue Feb 29, 2024 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@laugh12321
Copy link

While using CV-CUDA for GPU acceleration, a notable limitation is the absence of a direct conversion method from CV-CUDA tensor to PyTorch Tensor or PyCUDA GPUArray. While cvcuda.as_tensor facilitates the conversion from PyTorch Tensor or PyCUDA GPUArray to CV-CUDA tensor, a direct reverse conversion is not readily available. Additionally, converting to a NumPy array typically involves using torch.as_tensor followed by .cpu().numpy().

While studying the CV-CUDA source code it seems that the primary conversion method involves using torch.as_tensor. Is there an alternative conversion approach that doesn't rely on torch.as_tensor and enables direct conversion of a CV-CUDA tensor to PyCUDA GPUArray and NumPy array?

@laugh12321 laugh12321 added the question Further information is requested label Feb 29, 2024
@pmikolajczyk pmikolajczyk self-assigned this Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants