Autodiff apply to image pixel gradient

I tried several autodiff examples and they all work with a scalar function U(x) and x.grad[i] etc…
My question is if I want to perform a image gradient between adjacent pixels, meaning the function U itself would be 2 dimensional, can autodiff help?
The question arise when I try to convert a TV de-noising program (already works using Taichi) to using autodiff and see if there’s any performance improvement.
Thanks in advance.

1 Like