 Only in theano-base/theano/gof: sandbox
 diff -x '*.pyc' -uwr theano-base/theano/gradient.py theano/gradient.py
 --- theano-base/theano/gradient.py	2016-02-25 15:14:41.434999962 -0800
-+++ theano/gradient.py	2016-02-27 20:07:31.618998747 -0800
++++ theano/gradient.py	2016-02-27 20:10:36.933998714 -0800
 @@ -361,7 +361,8 @@
  
  def grad(cost, wrt, consider_constant=None,

-                                ("%s.grad returned a term with"
-                                 " %d dimensions, but %d are required.") % (
-                                     str(node.op), term.ndim, var.ndim))
+                        # if hasattr(var, 'ndim') and term.ndim != var.ndim:
+                        #     raise ValueError(
+                        #         ("%s.grad returned a term with"

 
                         terms.append(term)
 
@@ -1318,6 +1332,7 @@
                 # this variable isn't connected to the cost in the
                 # computational graph
                 grad_dict[var] = disconnected_type()
