Theano/Theano — Issue #457: theano.function accepts variables that should be exclusive
Author: lamblin
Created: 2012-02-20 18:19:24+00:00
State: open
Labels: Bug

For instance, it will accept the same input twice:
x = theano.tensor.lscalar('x')
f = theano.function([x, x, x], x)
f(1,2,3) # returns array(3)

Also, some inputs can mask others. For instance, if we have:
m = theano.tensor.lmatrix('m')
mt = m.T # transpose
g = theano.function([mt, m], mt)
g([[1,2,3]], [[4,5]]) # returns array([[1, 2, 3]])

There should be an error if in input is duplicated in the list of inputs, and also if both an intermediate variable (here, mt) and one of its ancestors is provided.