If I have a tensor x.
Can I define a vector function, say f(x)=(3x, x+2), in such a way that I can then obtain df/dx?
I hope my question is understood. In a nutshell: I want a way to define such a vector function, from which I can get its gradient.