Theano float64矩阵产品价值

2024-03-28 09:12:52 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要用float64精度矩阵做矩阵乘法。 以下代码在float32和matrix()中工作,而不是在dmatrix()中工作。 但是,当谈到float64时,它失败了。在

import theano
from theano import tensor as T
import numpy

x = numpy.ones((20000, 100), dtype=numpy.float64)
m = T.dmatrix()
mTm = T.dot(m.T, m)
f = theano.function([m], mTm)
f(x)
r = f(x)
r.shape

我有以下错误:

^{pr2}$

我该怎么解决这个问题?在


Tags: 代码fromimportnumpyas精度矩阵theano
2条回答

这个问题与GPU无关,而是您用于Theano标志的值blas.ld标志:'asdfadf'

当再次编译blas时,它被传递给g++。您没有输入值g++参数。在

查看the deep learning tutorial here看看现在只有当float32被传递时,no计算才从GPU中受益。另请参阅邮件列表上的this thread。在

相关问题 更多 >