Theano/Theano — pull request #986 by jlowin (2012-10-02 05:41:46+00:00)
Title: Allow dot products of n-dimensional variables

This pull request updates the dot op to allow "numpy semantics": passing variables with ndim other than 1 or 2 (including 0-dim scalars).

Note that the perform method is actually unchanged, as it always called numpy.dot -- this pr updates:
- make_node, which previously blocked variables with ndim other than 1 or 2
- grad, which previously only supported vectors and matrices
- infer_shape, which previously only supported vectors and matrices

Additionally, this restores the unit tests for dot products of scalars and tensors, and gradients thereof.

Things to consider:
1. I have no experience with writing R-op code and I haven't touched it here.
2. The gradient is only being tested via "verify_grad" -- are there more robust tests to implement?
3. It is quite probable that elementwise multiplication is faster than the dot product of a scalar.