提交 23c5a0f6 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Added 4 corrections related to Python3

上级 8b136149
...@@ -52,8 +52,8 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, ...@@ -52,8 +52,8 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
print(' OMP_NUM_THREADS=', os.getenv('OMP_NUM_THREADS')) print(' OMP_NUM_THREADS=', os.getenv('OMP_NUM_THREADS'))
print(' GOTO_NUM_THREADS=', os.getenv('GOTO_NUM_THREADS')) print(' GOTO_NUM_THREADS=', os.getenv('GOTO_NUM_THREADS'))
print() print()
print ('Numpy config: (used when the Theano flag' print('Numpy config: (used when the Theano flag'
' "blas.ldflags" is empty)') ' "blas.ldflags" is empty)')
numpy.show_config() numpy.show_config()
print('Numpy dot module:', numpy.dot.__module__) print('Numpy dot module:', numpy.dot.__module__)
print('Numpy location:', numpy.__file__) print('Numpy location:', numpy.__file__)
...@@ -306,6 +306,6 @@ if __name__ == "__main__": ...@@ -306,6 +306,6 @@ if __name__ == "__main__":
print() print()
print('Total execution time: %.2fs on %s.' % (t, impl)) print('Total execution time: %.2fs on %s.' % (t, impl))
print() print()
print ('Try to run this script a few times. Experience shows that' print('Try to run this script a few times. Experience shows that'
' the first time is not as fast as followings calls. The' ' the first time is not as fast as followings calls. The'
' difference is not big, but consistent.') ' difference is not big, but consistent.')
...@@ -16,6 +16,9 @@ try: ...@@ -16,6 +16,9 @@ try:
if cuda.cuda_available is False: if cuda.cuda_available is False:
raise ImportError('Optional theano package cuda disabled') raise ImportError('Optional theano package cuda disabled')
if PY3:
long = int
def cudandarray_to_cudamat(x, copyif=False): def cudandarray_to_cudamat(x, copyif=False):
""" take a CudaNdarray and return a cudamat.CUDAMatrix object. """ take a CudaNdarray and return a cudamat.CUDAMatrix object.
......
...@@ -15,6 +15,9 @@ try: ...@@ -15,6 +15,9 @@ try:
if cuda.cuda_available is False: if cuda.cuda_available is False:
raise ImportError('Optional theano package cuda disabled') raise ImportError('Optional theano package cuda disabled')
if PY3:
long = int
def cudandarray_to_garray(x, copyif=False): def cudandarray_to_garray(x, copyif=False):
""" take a CudaNdarray and return a gnumpy.garray object. """ take a CudaNdarray and return a gnumpy.garray object.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论