Re: [theano-users] which function in theano implement numpy.where?

2016-11-23 Thread linzheshabia
Thank you Mr. Lamblin, you reply is helpful :) On Wednesday, November 23, 2016 at 8:02:10 AM UTC+8, Pascal Lamblin wrote: > > Hi, > > The only syntax we currently support in tensor.where is the one where > two additional argument are provided, like in: > > >>> numpy.where(a > 3, a, a + 3) >

Re: [theano-users] which function in theano implement numpy.where?

2016-11-22 Thread Pascal Lamblin
Hi, The only syntax we currently support in tensor.where is the one where two additional argument are provided, like in: >>> numpy.where(a > 3, a, a + 3) array([3, 4, 5, 6, 4, 5, 6, 7, 8, 9]) >>> x = tensor.vector() >>> tensor.where(x > 3, x, x + 3).eval({x: a}) array([ 3., 4., 5., 6., 4.,

[theano-users] which function in theano implement numpy.where?

2016-11-22 Thread linzheshabia
Dear all, I wanna to use np.where in theano. However, it seems that theano.tensor.where is not doing the same things as numpy.where will do. Is there any function i can use in theano? For example, a = numpy.arange(10) index = numpy.where(a>a[0]) How to implement the code above in theano? --