0
class sharedvariable_test:
def __init__(self, sizes):
self.param = [theano.shared(p)
for p in sizes]
def update(self):
temp_p = [None] * len(self.param)
for i in range(len(self.param)):
temp_p[i] = 1
self.param = [p.set_value(tp)
for p, tp in zip(self.param, temp_p)]
for p in self.param:
print(p.get_value()) # error occurred here
值的函數更新後後,在列表self.param共享變量變得NoneType,錯誤消息是「該NoneType沒有的get_value的屬性」,和是我應該命名共享變量?而不是僅僅把它變成一個列表共享變量成爲NoneType設置在theano