I have a list :
my_list = [[1,2,3,4], [4,5,6], [1,2,1,2,1,2]]
I also have a tensor variable:
a_tensor = theano.tensor.ivector("tensor")
now I want to use theano.scan to get the corresponding item in the list given the index:
result, _ = theano.scan(fn=lambda idx, a_list:a_list[idx],
sequences=[a_tensor],
non_sequences=theano.shared(np.array(my_list)))
but got the error: *TypeError: The generic 'SharedVariable' object is not subscriptable. This shared variable contains a Numpy array with dtype: 'object'. This data type is not currently recognized by Theano tensors: please cast your data into a supported numeric type if you need Theano tensor functionalities. *
I'm very new to Theano so I'm probably thinking about this problem in the wrong way. I would really appreciate any advice.