我有一个 csv 文件要更改为 thenao.tensor,我计划通过 2 个步骤来完成 1 csv 到 ndarray:使用 genfromtxt 方法很容易。 2 ndarray 到 theano.tensor:这一步怎么做?有示例代码吗?
谢谢!
最佳答案
您可以使用_shared
,显然:http://deeplearning.net/software/theano/library/tensor/basic.html#converting-from-python-objects
from theano.tensor import _shared
import numpy as np
x = _shared(np.arange(10))
关于python - 如何将 numpy.ndarray 对象转换为 theano.tensor?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31395027/