Their is also a mix of * here and use of dot in the example. Always use dot() for the dot product, this is a numpy/theano choose. * is always elemwise product. Probably in python 3.5,  A @ B will mean matrix product.