train_set_x has to be a Theano variable (symbolic or shared), not a numpy array.
On Sun, Aug 21, 2016, fang jack wrote:
> import theano.tensor as T
> import theano
> import numpy
> index =T.lscalar()
> x=T.dmatrix()
> cost=x +index
> train_set_x=numpy.arange(100).reshape([20,5])
> fff=theano.function(inputs=[index],
> outputs=cost,
> givens={x:train_set_x[index: index+1]}) <--- Error
> here
>
>
> it gave me " IndexError: fail to coerce slice entry of type tensorvariable
> to integer " error message
> at line "givens={x:train_set_x[index: index+1]})"
>
> is there someone can help ?
> thanks
>
> --
>
> ---
> 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.