Let's say we have a mathematical expression, $$ \mathbf{y} = \mathbf{Ax}, $$ where $\mathbf{y}$ and $\mathbf{x}$ are a vector, and $\mathbf{A}$ is a matrix. Let's say the vector $\mathbf{y}$ is used to calculate a loss function $\mathcal{L}$ and the gradient $\mathbf{g_y} = \partial\mathcal{L}/\partial\mathbf{y}$ (which is also a vector) is available.

For real-valued tensors, I can understand providing grad_outputs in torch.autograd.grad, e.g. torch.autograd.grad(y, x, grad_outputs=gy) is like calculating the expression below, $$ \frac{\partial\mathcal{L}}{\partial\mathbf{x}} = \mathbf{g_y}^T \frac{\partial\mathbf{y}}{\partial\mathbf{x}}. $$

My question is: what mathematical expression does it calculate if all of the variables are complex?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.