If the number of split is constant, it can be done. You split in 3 vector: v1, v2, v3 = vector[0:splits[0]], vector[splits[0]:splits[1]], ... s1=v1.sum() s2=v3.sum() theano.tensor.concatenate(s1,s2,s3)
Fred On Wed, Jul 20, 2016 at 5:34 PM, Aditya Gudimella < [email protected]> wrote: > Given a vector and a list of indices, is it possible to find the sum of > the vector split according to the indices? > if > vector = [1,2,3,4,5,6,7,8] > splits = [2,3,3] > > result would be [1+2, 3+4+5, 6+7+8] > > This is easy to do with scan but is it possible to do this without scan in > such a way that the output still passes through theano's automatic > differentiation? > > -- > > --- > 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.
