Theano中int32和float32的点积产生float64
The dot product of int32 and float32 produces float64 in Theano
当我编译函数时
x = theano.tensor.imatrix('x')
y = theano.tensor.fmatrix('y')
z = x.dot(y)
f = theano.function([x, y], z)
结果输出是 float64,即使 x 是 int32 类型,y 是 float32 类型。当我计算相同的操作时,其中 x 是 float32 类型的 Theano fmatrix,结果矩阵是 float32。为什么在前一种情况下不保留较小的位大小?换句话说,为什么 int32 和 float32 的点积等于 float64 而不是 Theano 中的 float32?
我正在使用 Theano 版本 0.9.0
当我编译函数时
x = theano.tensor.imatrix('x')
y = theano.tensor.fmatrix('y')
z = x.dot(y)
f = theano.function([x, y], z)
结果输出是 float64,即使 x 是 int32 类型,y 是 float32 类型。当我计算相同的操作时,其中 x 是 float32 类型的 Theano fmatrix,结果矩阵是 float32。为什么在前一种情况下不保留较小的位大小?换句话说,为什么 int32 和 float32 的点积等于 float64 而不是 Theano 中的 float32?
我正在使用 Theano 版本 0.9.0