Need to find Jacobian of a matrix with respect to another matrix

Problem 1:
I have a parameter matrix A and an input matrix X . My output matrix Y is Y=AX . How to find the Jacobian of Y with respect to X?

Problem 2:
I have a parameter matrix A, parameter matrix B and an input matrix X . My output matrix Y is Y=AXB . How to find the Jacobian of Y with respect to X?

Please help!

do you mean to do something like this using pytorch?

Problem 1:


Problem 2:


1 Like