Solved by albanD in post #2 
              
              
                Hi, 
Yes we follow a slightly different semantic. 
The usual definition for multivariate functions is given a 1D input and 1D output, you end up with as 2D Jacobian. 
What sympy is doing here is to linearize the inputs from a (2, 2) Tensor into a (4,) Tensor. And so the Jacobian is (2, 4). 
Because …