On Thu, Nov 03, 2016, Nick wrote:
> I think I can do x[x < T.max(x,axis=-1)] = 0 .. but theano shared doesnt 
> support assignment

Theano does not support assignment, you have to use T.set_subtensor
instead, and used the returned value.

Moreover, indexing with a mask is not supported yet, but you can use nonzeros().

For instance, your case would look something like:

y = T.set_subtensor(x[(x < x.max(axis=-1, keepdims=True)).nonzeros()], 0)

> 
> On Thursday, November 3, 2016 at 8:49:25 PM UTC-4, Nick wrote:
> >
> > For example, 
> >
> > x = [[1,2],[3,4]] => [[0,0],[3,4]]
> >
> > I'm trying to do this but cant seem to get broadcastables right..
> >
> > I know columnwise max would be T.max(x,axis=-1) .. What to do from there?
> >
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "theano-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.


-- 
Pascal

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to