sympy/sympy — pull request #2366 by mrocklin (2013-08-08 21:00:15+00:00)
Title: Theano Piecewise

Add a translation from SymPy.Piecewise to Theano.switch. This required correcting the translations for inequalities.

```Python
In [1]: expr = Piecewise((0, x<0), (x, x<2), (1, True))
In [2]: from sympy.printing.theanocode import *
In [3]: f = theano_function([x], [expr], dtypes={x: 'float64'}, dims={x: 1})
In [4]: import numpy as np
In [5]: data = np.linspace(-2, 4, 15)

In [6]: f(data)
Out[6]:
array([ 0. , 0. , 0. , 0. , 0. ,
0.14285714, 0.57142857, 1. , 1.42857143, 1.85714286,
1. , 1. , 1. , 1. , 1. ])
```

CC @nouiz