You can try to implement it with tensor.alloc() and set_subtensor with broadcasting.
this will work with gradient and on the GPU. On Thu, May 3, 2018 at 7:02 PM Pascal Lamblin <[email protected]> wrote: > Oh, right. > > Then, I don't think it will be implemented. > And I don't think RepeatOp is optimized to use the GPU anyway. > > > Sorry about that > > On 2018-05-03 06:01 PM, Kristjan Arumae wrote: > > No, it only works with two vectors. 2 Matrixes is not supported in > > numpy either I don't think, since it is likely to mess up the output > shape. > > > > On Thursday, May 3, 2018 at 4:03:15 PM UTC-4, Pascal Lamblin wrote: > > > > Does it work with two matrices? > > If so, you can try to use dimshuffle to make v a "row" instead of a > > "vector". > > > > On 2018-05-03 03:24 PM, Kristjan Arumae wrote: > > > An example of what I am doing: > > > > > > Here m is an fmatrix, and v is an ivector > > > > > > out = T.repeat(m, v, axis=0) > > > > > > The forward pass works fine, but there is no gradient code > > implemented. > > > > > > This works fine when both inputs are vectors but not as above. > > > > > > I am not familiar with theano enough to fill in the missing code > in > > > grad() for class RepeatOp(). Does anyone have suggestions as to a > > > workaround? I have not found anything even remotely helpful so > far. > > > I've tried using tile with scan, but to no end. > > > > > > 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] <javascript:> > > > <mailto:[email protected] <javascript:>>. > > > For more options, visit https://groups.google.com/d/optout > > <https://groups.google.com/d/optout>. > > > > -- > > Pascal Lamblin > > > > -- > > > > --- > > 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] > > <mailto:[email protected]>. > > For more options, visit https://groups.google.com/d/optout. > > -- > Pascal Lamblin > > -- > > --- > 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.
