title: numpy: how to calculate jacobian matrix
body: <p>I made an example of the dot product of two matrices, and I want to calculate the jacobian matrix of this dot product. The first matrix has a shape of 4x3, and the second matrix has the shape 2x4. The resulting jacobian matrix should have a shape of (4x3x2x3) because I am calculating it w.r.t the first matrix.</p>
  
  <p>So lets say each element of the jacobian matrix is DiDjAkAl, that element would represent the partial derivative of the i,j output w.r.t the k,l input. Here's the example in code:</p>
  
  <pre><code>import numpy as np
  
  A = np.array([[1,2,3,4],
                [5,6,7,8],
                [9,10,11,12]])
  #shape = (4x3)
  
  b = np.array([[1,2],
                [3,4],
                [5,6],
                [7,8]])
  #shape = (2x4)
  
  dotProduct = A.dot(b)
  #shape = (2x3)
  </code></pre>
  
  <p>So basically my question is how to find the jacobian of that dot product. </p>