Theano/Theano — pull request #1654 by lamblin (2013-12-09 19:40:28+00:00)
Title: [WIP] Use gradient_undefined instead of None in MRG uniform

The test that was failing now fails with a new error:

```
======================================================================
ERROR: theano.sandbox.test_rng_mrg.test_gradient_scan
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/lisa/os/epd-7.1.2/lib/python2.7/site-packages/nose/case.py", line 187, in runTest
self.test(*self.arg)
File "/u/lamblinp/code/Theano_git/theano/sandbox/test_rng_mrg.py", line 768, in test_gradient_scan
theano.grad(tensor.sum(values[-1]), w)
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 528, in grad
grad_dict, wrt, cost_name)
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 1103, in _populate_grad_dict
rval = [access_grad_cache(elem) for elem in wrt]
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 1063, in access_grad_cache
term = access_term_cache(node)[idx]
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 924, in access_term_cache
input_grads = node.op.grad(inputs, new_output_grads)
File "/u/lamblinp/code/Theano_git/theano/scan_module/scan_op.py", line 1527, in grad
_dC_dinps_t = compute_gradient(Xt, dC_dXt)
File "/u/lamblinp/code/Theano_git/theano/scan_module/scan_op.py", line 1485, in compute_gradient
return_disconnected='None')
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 528, in grad
grad_dict, wrt, cost_name)
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 1103, in _populate_grad_dict
rval = [access_grad_cache(elem) for elem in wrt]
File "/u/lamblinp/code/Theano_git/theano/gradient.py", line 1073, in access_grad_cache
term.type.why_null)
NullTypeGradError: tensor.grad encountered a NaN. This variable is Null because the grad method for input 0 () of the mrg_uniform{TensorType(float32, vector),no_inplace} op is mathematically undefined. No gradient defined through random sampling op
```