def sharedX_mtx(mtx, name=None, borrow=None, dtype=None):
"""Share a matrix value with type theano.confgig.floatX.
Parameters:
value: matrix array
name: variable name (str)
borrow: boolean
dtype: the type of the value when shared. default: theano.config.floatX
"""
if dtype is None:
dtype = theano.config.floatX
return theano.shared(
np.array(mtx, dtype=dtype), name=name, borrow=borrow)
评论列表
文章目录