提交 6dc377c1 authored 作者: abalkin's avatar abalkin

More python 3.x fixes.

上级 901583ea
...@@ -6,7 +6,7 @@ import shutil ...@@ -6,7 +6,7 @@ import shutil
import stat import stat
import sys import sys
import numpy import six
import theano import theano
from theano.compile import optdb from theano.compile import optdb
...@@ -243,7 +243,7 @@ class GpuOp(theano.gof.Op): ...@@ -243,7 +243,7 @@ class GpuOp(theano.gof.Op):
return super(GpuOp, self).make_thunk(node, storage_map, return super(GpuOp, self).make_thunk(node, storage_map,
compute_map, no_recycling) compute_map, no_recycling)
theano.compile.debugmode.default_make_thunk.append(GpuOp.make_thunk.im_func) theano.compile.debugmode.default_make_thunk.append(six.get_unbound_function(GpuOp.make_thunk))
# We must do those import to be able to create the full doc when # We must do those import to be able to create the full doc when
# nvcc is not available # nvcc is not available
......
...@@ -8,6 +8,7 @@ from tempfile import mkstemp ...@@ -8,6 +8,7 @@ from tempfile import mkstemp
import unittest import unittest
import warnings import warnings
from copy import copy, deepcopy from copy import copy, deepcopy
from itertools import izip
# Import builtin min to be able to use it after importing the tensor version. # Import builtin min to be able to use it after importing the tensor version.
import __builtin__ import __builtin__
builtin_min = __builtin__.min builtin_min = __builtin__.min
...@@ -25,7 +26,7 @@ from theano.gof.python25 import any, all, combinations ...@@ -25,7 +26,7 @@ from theano.gof.python25 import any, all, combinations
from theano.tensor import (_shared, wvector, bvector, autocast_float_as, from theano.tensor import (_shared, wvector, bvector, autocast_float_as,
argmin, max_and_argmax, cscalar, Subtensor, ctensor3, join, argmin, max_and_argmax, cscalar, Subtensor, ctensor3, join,
horizontal_stack, vertical_stack, argmax, get_vector_length, horizontal_stack, vertical_stack, argmax, get_vector_length,
fscalar, zeros_like, sum, tensor3, vector, izip, add, addbroadcast, fscalar, zeros_like, sum, tensor3, vector, add, addbroadcast,
alloc, as_tensor_variable, tensor_from_scalar, ARange, autocast_float, alloc, as_tensor_variable, tensor_from_scalar, ARange, autocast_float,
clip, constant, default, dot, inc_subtensor, set_subtensor, clip, constant, default, dot, inc_subtensor, set_subtensor,
dmatrix, dscalar, dvector, eq, eye, fill, flatten, inverse_permutation, dmatrix, dscalar, dvector, eq, eye, fill, flatten, inverse_permutation,
......
try: try:
from main import main, TheanoNoseTester from theano.tests.main import main, TheanoNoseTester
except ImportError: except ImportError:
pass pass
import unittest_tools from theano.tests import unittest_tools
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论