2016-05-15 78 views
0

我创建了一个数量的共享变量,并把他们安置在一个数组,像这样:无法访问theano共享变量

self.params = [self.We, self.Wr, self.Wv, self.b]

当我试图让代码的另一部分自己的价值,这样的事情:

self.h = [theano.shared(value=p.get_value()*0.) for p in self.params]

我得到这个错误:

AttributeError: 'TensorVariable' object has no attribute 'get_value'

任何帮助真的很感激。

+0

你能不能给你完整的代码,什么是“P” ? – malioboro

回答

0

问题是,eventhough我使用的共享API,我也投给FLOAT32与.astype(theano.config.floatX),这是造成从sharedVariable转换只是tensorVariable