title: Multiplying a 2d array with each slice of 3d array - Numpy
body: <p>I am looking for an optimized way of computing a element wise multiplication of a 2d array by each slice of a 3d array (using numpy).</p>
  
  <p>for example: </p>
  
  <p><code>w = np.array([[1,5], [4,9], [12,15]])
  y = np.ones((3,2,3))</code></p>
  
  <p>I want to get a result as a 3d array with the same shape as <code>y</code>.</p>
  
  <p>Broadcasting using the * operator is not allowed.
  In my case, the third dimensions is very long and a for loop is not convenient.</p>