Hi,
If you want to use OpenCV, you won’t be able to use autograd (just like if you want to use numpy).
You will need to write a custom autograd Function to tell the autograd what the backward should be: https://pytorch.org/docs/stable/notes/extending.html 31