Aditya369
Aditya369

Reputation: 834

Theano force tensor elements to be value

I have a theano tensor W. I want to force some elements of W to be 2. How do I do it? I know that theano TensorVariable does not support item assignment. Is it not possible to do this? I can not use a shared variable for it as W is derived from another theano variable.

Upvotes: 0

Views: 42

Answers (1)

harshil
harshil

Reputation: 3250

You can try set_subtensor in theano.tensor. The example provided there should hopefully be sufficiently clear.

Upvotes: 1

Related Questions