What is the error you have? You define x as a scalar, but you pass a matrix. This ain't work. But maybe this isn't your original error.
Le 10 déc. 2016 21:20, "Junbin Gao" <[email protected]> a écrit : > The following code produces index int64 error. Not sure what happened. > Thanks heaps for your help. > > tl = theano.typed_list.TypedListType(theano.tensor.fmatrix)() > l = theano.typed_list.length(tl) > x = T.TensorType(dtype='float32', broadcastable=())('myvar') > results, updates = theano.scan(lambda prior_result, i, b: > T.tensordot(prior_result, b[i], [[i],[1]]), > sequences=[theano.tensor.arange(2, > dtype='int64')], > non_sequences=[tl], > outputs_info=[x]) > final_result = results[-1] > tucker = theano.function(inputs=[x, b], outputs=final_result, > updates=updates) > > X = np.array([[1, 2],[3, 4]]) > B =[np.array([[1, 2],[3, 4], [1, 3]]), np.array([[2, 1],[3, 1], [2, 3]])] > tucker(X,B) > > > -- > > --- > 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.
