11
我有一个从施放共享变量创建的theano张量变量。我怎样才能提取原始或铸造值? (我需要让我不必随身携带的原始共享/ numpy的值。)如何从共享变量支持的theano张量变量中获取值?
>>> x = theano.shared(numpy.asarray([1, 2, 3], dtype='float'))
>>> y = theano.tensor.cast(x, 'int32')
>>> y.get_value(borrow=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'TensorVariable' object has no attribute 'get_value'
# whereas I can do this against the original shared variable
>>> x.get_value(borrow=True)
array([ 1., 2., 3.])