In that special case, it will work. But if you end up using higher level
tensor, then you will need a bigger graph.

I think it make sence to hide that graph building in theano. So if someone
is interreted to contribute a unravel_index function in Theano, that would
be great.

Fred

On Mon, Oct 24, 2016 at 11:07 PM, <[email protected]> wrote:

> Thanks for your answer.
> But you know that data transfer between CPU and GPU is not fast. I use
> theano to implenment it in this way:
>
> x = T.int_div(out, A.shape[0])
> y = T.mod(out, A,shape[0])
>
>
>
> nouiz於 2016年10月25日星期二 UTC+8上午4時40分01秒寫道:
>>
>> There isn't a built in. But numpy can do it:
>>
>>  np.unravel_index(out, Avalue.shape)
>>
>>
>>
>>
>> On Mon, Oct 24, 2016 at 5:07 AM, <[email protected]> wrote:
>>
>>> Hello everyone!
>>> I meet a little trouble here.
>>> Given a matrix, i would like to get the index of minimum value in this
>>> matrix.
>>>
>>> For example,
>>> A = T.imatrix('A')
>>> index = A.argmax()
>>> return_index= theano.function([A],index)
>>> Avalue = numpy.arange(9).reshape(3,3)
>>> out = return_index(Avalue)
>>>
>>>
>>> out is given value 0 instead of (0,0). I would like to get the (0,0)
>>> I am wondering that if there are any build-in function in theano.tensor
>>> i can use?
>>>
>>> --
>>>
>>> ---
>>> 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.
>>>
>>
>> --
>
> ---
> 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.
>

-- 

--- 
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