Running custom CUDA code using PyTorch

Hello,
I am using PyCUDA, and recently started using PyTorch due to its native GPU tensor support.

I would like to write a new PyTorch method, lets say converting an RGB image to BW (see the PyCUDA equivalent here:https://github.com/QuantScientist/Data-Science-PyCUDA-GPU/blob/master/day%2002%20PyTORCH%20and%20PyCUDA/PyCUDA/05%20PyCUDA%20image%20processing.ipynb) that uses CUDA directly.

Is that possible?

Thanks,

1 Like