title: How is theano dot product broadcasted
body: <p>Could anyone example how i theano dot product broadcast. It seems it is different from numpy</p>
  
  <pre><code>import numpy
  import theano
  import theano.tensor as T
  
  theano.config.compute_test_value = 'off'
  
  W1val = numpy.random.rand(2, 5, 10, 4).astype(theano.config.floatX)
  
  W1 = theano.shared(W1val, 'W1')
  
  x  = T.tensor3('x')
  
  func_of_W1 = W1
  
  h1 = T.dot(x, func_of_W1)
  
  f = theano.function([x], h1)
  
  print f(numpy.random.rand(3, 5, 10)).shape
  </code></pre>
  
  <p>Here are the experiments I tried with theano.</p>
  
  <pre><code>#   T.dot(x shape ,  W1 shape) = result shape
  
  # (3, 5, 10) * (2, 5, 10, 4) = (3, 5, 2, 5, 4)
  
  # (3, 10) * (2, 5, 10, 4) = (3, 2, 5, 4)
  
  # (3, 10) * (10 ,4) = (3, 4)
  
  # (3, 10) * (2, 10 ,4) = (3, 2, 4)
  
  # (5,10) * (2, 10 ,10) = (5, 2, 10)
  </code></pre>