提交 e14e9c33 authored 作者: David Warde-Farley's avatar David Warde-Farley 提交者: Arnaud Bergeron

reduce() and xrange() from six.

上级 af1314a0
...@@ -8,6 +8,7 @@ import time ...@@ -8,6 +8,7 @@ import time
import theano import theano
import theano.tensor as T import theano.tensor as T
import theano.sandbox import theano.sandbox
from theano.compat.six.moves import xrange
from theano.compile import module, Mode, ProfileMode from theano.compile import module, Mode, ProfileMode
from theano import gof, Op, Apply from theano import gof, Op, Apply
......
...@@ -4,6 +4,7 @@ from __future__ import absolute_import ...@@ -4,6 +4,7 @@ from __future__ import absolute_import
import numpy as N import numpy as N
import sys import sys
import time import time
from theano.compat.six.moves import xrange
# c: aa.cc # c: aa.cc
......
...@@ -3,6 +3,7 @@ import theano ...@@ -3,6 +3,7 @@ import theano
import numpy as N import numpy as N
from theano import tensor as T from theano import tensor as T
from theano.tensor import nnet as NN from theano.tensor import nnet as NN
from theano.compat.six.moves import xrange
from theano.compile import module as M from theano.compile import module as M
class RegressionLayer(M.Module): class RegressionLayer(M.Module):
......
...@@ -5,6 +5,7 @@ import numpy ...@@ -5,6 +5,7 @@ import numpy
import theano import theano
from theano import tensor as tt from theano import tensor as tt
from theano.compat.six.moves import xrange
from theano.ifelse import ifelse from theano.ifelse import ifelse
a, b = tt.scalars('a', 'b') a, b = tt.scalars('a', 'b')
......
from __future__ import print_function from __future__ import print_function
import theano import theano
import theano.tensor as tt import theano.tensor as tt
from theano.compat.six.moves import xrange
k = tt.iscalar("k") k = tt.iscalar("k")
A = tt.vector("A") A = tt.vector("A")
......
from __future__ import print_function from __future__ import print_function
import theano import theano
import theano.tensor as T import theano.tensor as T
from theano.compat.six.moves import xrange
k = T.iscalar("k"); A = T.vector("A") k = T.iscalar("k"); A = T.vector("A")
......
...@@ -6,6 +6,7 @@ import numpy ...@@ -6,6 +6,7 @@ import numpy
import theano import theano
import theano.tensor as tt import theano.tensor as tt
from theano.compat.six.moves import xrange
# 1. First example # 1. First example
......
...@@ -17,8 +17,8 @@ import numpy ...@@ -17,8 +17,8 @@ import numpy
import theano import theano
from theano import gof from theano import gof
from theano.compat import get_unbound_function, product as itertools_product from theano.compat import get_unbound_function, product as itertools_product
from theano.compat.six import StringIO from theano.compat.six.moves import StringIO, xrange
from theano.gof import (graph, utils, link, from theano.gof import (FunctionGraph, graph, utils, link,
ops_with_inner_function) ops_with_inner_function)
from theano.gof.link import raise_with_op from theano.gof.link import raise_with_op
from theano.configparser import (config, AddConfigVar, BoolParam, IntParam, from theano.configparser import (config, AddConfigVar, BoolParam, IntParam,
......
...@@ -13,6 +13,7 @@ import numpy ...@@ -13,6 +13,7 @@ import numpy
import theano import theano
from theano import gof from theano import gof
from theano.compat import partial from theano.compat import partial
from theano.compat.six.moves import xrange
import theano.compile.mode import theano.compile.mode
from theano.compile.io import ( from theano.compile.io import (
In, SymbolicInput, SymbolicInputKit, SymbolicOutput) In, SymbolicInput, SymbolicInputKit, SymbolicOutput)
......
...@@ -9,6 +9,7 @@ import warnings ...@@ -9,6 +9,7 @@ import warnings
import theano import theano
from theano import gof from theano import gof
from theano.compat.six.moves import xrange
import numpy import numpy
......
...@@ -12,7 +12,7 @@ from itertools import izip ...@@ -12,7 +12,7 @@ from itertools import izip
import numpy import numpy
from theano.compat import PY3 from theano.compat import PY3
from theano.compat.six import StringIO from theano.compat.six.moves import StringIO, xrange
from theano.gof.utils import MethodNotDefined from theano.gof.utils import MethodNotDefined
import theano import theano
......
...@@ -16,6 +16,7 @@ import numpy ...@@ -16,6 +16,7 @@ import numpy
import theano import theano
from theano import config from theano import config
from theano.compat.six.moves import reduce
from theano.gof import graph, op, utils, unify, toolbox from theano.gof import graph, op, utils, unify, toolbox
from theano.gof.fg import InconsistencyError from theano.gof.fg import InconsistencyError
from theano.compat import deque from theano.compat import deque
......
from __future__ import print_function from __future__ import print_function
from theano.compat.six.moves import reduce
if 0: if 0:
class _EquilibriumOptimizer(NavigatorOptimizer): class _EquilibriumOptimizer(NavigatorOptimizer):
......
...@@ -2,6 +2,7 @@ from __future__ import print_function ...@@ -2,6 +2,7 @@ from __future__ import print_function
import unittest import unittest
from theano.compat.six.moves import xrange
from theano.gof.type import Type from theano.gof.type import Type
from theano.gof import graph from theano.gof import graph
from theano.gof.graph import Variable, Apply from theano.gof.graph import Variable, Apply
......
...@@ -5,6 +5,7 @@ import numpy ...@@ -5,6 +5,7 @@ import numpy
import theano import theano
import theano.gof.op as op import theano.gof.op as op
from theano.compat.six.moves import xrange
from theano.gof.type import Type, Generic from theano.gof.type import Type, Generic
from theano.gof.graph import Apply, Variable from theano.gof.graph import Apply, Variable
import theano.tensor as T import theano.tensor as T
......
...@@ -5,6 +5,7 @@ import theano ...@@ -5,6 +5,7 @@ import theano
from theano import tensor from theano import tensor
from theano.gof.graph import io_toposort from theano.gof.graph import io_toposort
from theano.compat import cmp from theano.compat import cmp
from theano.compat.six.moves import xrange
def test_dependence(): def test_dependence():
......
import theano import theano
from theano.gof.utils import give_variables_names, unique, remove from theano.gof.utils import give_variables_names, unique, remove
from theano.compat.six.moves import xrange
def test_give_variables_names(): def test_give_variables_names():
......
...@@ -10,6 +10,7 @@ import numpy ...@@ -10,6 +10,7 @@ import numpy
from theano import function from theano import function
from theano.gof import vm from theano.gof import vm
from theano.gof import OpWiseCLinker from theano.gof import OpWiseCLinker
from theano.compat.six.moves import xrange
from theano.compile import Mode from theano.compile import Mode
from theano import tensor from theano import tensor
......
...@@ -16,6 +16,7 @@ from theano.configparser import (config, AddConfigVar, ...@@ -16,6 +16,7 @@ from theano.configparser import (config, AddConfigVar,
import theano.gof.cmodule import theano.gof.cmodule
from theano.compat import defaultdict from theano.compat import defaultdict
from theano.compat.six.moves import xrange
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
...@@ -13,6 +13,7 @@ import theano ...@@ -13,6 +13,7 @@ import theano
from theano import gof from theano import gof
from theano.gof import Variable from theano.gof import Variable
from theano.compat import OrderedDict from theano.compat import OrderedDict
from theano.compat.six.moves import xrange
from theano.gof.null_type import NullType, null_type from theano.gof.null_type import NullType, null_type
from theano.gof.op import get_debug_values from theano.gof.op import get_debug_values
from theano.compile import ViewOp from theano.compile import ViewOp
......
...@@ -22,6 +22,7 @@ from theano.tensor import TensorType ...@@ -22,6 +22,7 @@ from theano.tensor import TensorType
from theano import gof from theano import gof
from theano.gof import PureOp, Apply from theano.gof import PureOp, Apply
from theano.compat.six.moves import xrange
from theano.compile import optdb from theano.compile import optdb
from theano.tensor import opt from theano.tensor import opt
from theano.scan_module.scan_utils import find_up from theano.scan_module.scan_utils import find_up
......
...@@ -7,6 +7,7 @@ import numpy as np ...@@ -7,6 +7,7 @@ import numpy as np
import theano import theano
import theano.tensor as T import theano.tensor as T
from theano.compat.six.moves import xrange
parser = OptionParser(usage='%prog <options>\n Compute time for' parser = OptionParser(usage='%prog <options>\n Compute time for'
' fast and slow elemwise operations') ' fast and slow elemwise operations')
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
This code can only work if gnumpy and theano are initialized on the This code can only work if gnumpy and theano are initialized on the
same gpu as theano. same gpu as theano.
""" """
from theano.compat.six.moves import reduce
try: try:
import gnumpy import gnumpy
......
...@@ -45,6 +45,7 @@ __version__ = "1" ...@@ -45,6 +45,7 @@ __version__ = "1"
import tokenize import tokenize
import os, shutil import os, shutil
import sys import sys
from theano.compat.six.moves import xrange
verbose = 0 verbose = 0
recurse = 0 recurse = 0
......
...@@ -23,6 +23,7 @@ TheanoElementwiseKernel. ...@@ -23,6 +23,7 @@ TheanoElementwiseKernel.
import numpy import numpy
import theano import theano
from theano.compat.six.moves import xrange
from theano.gof import Op, Apply, local_optimizer, EquilibriumDB from theano.gof import Op, Apply, local_optimizer, EquilibriumDB
from theano.sandbox.cuda import GpuElemwise, CudaNdarrayType, GpuOp from theano.sandbox.cuda import GpuElemwise, CudaNdarrayType, GpuOp
from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable, from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
......
import warnings import warnings
from theano.compat.six.moves import xrange
def render_string(string, sub): def render_string(string, sub):
......
...@@ -25,7 +25,7 @@ except ImportError: ...@@ -25,7 +25,7 @@ except ImportError:
import theano import theano
from theano import gof from theano import gof
from theano import config from theano import config
from theano.compat.six import StringIO from theano.compat.six.moves import StringIO, reduce
from theano.gof import Op, Apply from theano.gof import Op, Apply
from theano.compile import Function, debugmode from theano.compile import Function, debugmode
from theano.compile.profilemode import ProfileMode from theano.compile.profilemode import ProfileMode
......
...@@ -3,6 +3,7 @@ import numpy ...@@ -3,6 +3,7 @@ import numpy
import theano import theano
import theano.tensor as T import theano.tensor as T
from theano.compat.six.moves import xrange
from theano.gof import local_optimizer from theano.gof import local_optimizer
from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable from theano.sandbox.cuda.basic_ops import as_cuda_ndarray_variable
from theano.misc import strutil from theano.misc import strutil
......
...@@ -5,6 +5,7 @@ import theano.tensor as T ...@@ -5,6 +5,7 @@ import theano.tensor as T
from theano.misc import strutil from theano.misc import strutil
import theano import theano
from theano.compat.six.moves import xrange
from theano.tensor.nnet.ConvTransp3D import ConvTransp3D from theano.tensor.nnet.ConvTransp3D import ConvTransp3D
from theano.gof import local_optimizer from theano.gof import local_optimizer
......
...@@ -9,7 +9,7 @@ import theano ...@@ -9,7 +9,7 @@ import theano
from theano import gof, Type, Apply from theano import gof, Type, Apply
from theano import tensor, scalar, config from theano import tensor, scalar, config
from theano.compat.six import StringIO from theano.compat.six.moves import StringIO, xrange
from theano.gradient import grad_undefined from theano.gradient import grad_undefined
from theano.scalar import Scalar from theano.scalar import Scalar
......
...@@ -7,7 +7,7 @@ _logger = logging.getLogger(__name__) ...@@ -7,7 +7,7 @@ _logger = logging.getLogger(__name__)
import theano import theano
from theano import Apply from theano import Apply
from theano import tensor from theano import tensor
from theano.compat.six import StringIO from theano.compat.six.moves import StringIO, reduce
from theano.sandbox.cuda.type import CudaNdarrayType from theano.sandbox.cuda.type import CudaNdarrayType
from theano.sandbox.cuda import GpuOp from theano.sandbox.cuda import GpuOp
from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable, from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
......
...@@ -15,6 +15,7 @@ from theano import scalar as scal ...@@ -15,6 +15,7 @@ from theano import scalar as scal
from theano import config, tensor, gof from theano import config, tensor, gof
import theano.ifelse import theano.ifelse
from theano.compat.six.moves import reduce
from theano.compile import optdb from theano.compile import optdb
from theano.gof import (local_optimizer, EquilibriumDB, ProxyDB, from theano.gof import (local_optimizer, EquilibriumDB, ProxyDB,
Optimizer, toolbox) Optimizer, toolbox)
......
...@@ -9,6 +9,7 @@ from nose.plugins.skip import SkipTest ...@@ -9,6 +9,7 @@ from nose.plugins.skip import SkipTest
from nose.tools import assert_raises from nose.tools import assert_raises
import theano import theano
from theano.compat.six.moves import reduce
from theano.compile.pfunc import pfunc from theano.compile.pfunc import pfunc
from theano import config, tensor from theano import config, tensor
import theano.tensor.tests.test_nlinalg import theano.tensor.tests.test_nlinalg
......
...@@ -3,6 +3,7 @@ import os ...@@ -3,6 +3,7 @@ import os
import theano import theano
from theano import config, gof from theano import config, gof
from theano.compat.six.moves import reduce
from .comp import NVCC_compiler from .comp import NVCC_compiler
from .type import GpuArrayType from .type import GpuArrayType
from .basic_ops import as_gpuarray_variable from .basic_ops import as_gpuarray_variable
......
...@@ -140,6 +140,7 @@ except ImportError: ...@@ -140,6 +140,7 @@ except ImportError:
pass pass
from theano.configparser import config, AddConfigVar, StrParam from theano.configparser import config, AddConfigVar, StrParam
from theano.compat.six.moves import reduce
from theano.gof import (utils, Op, view_roots, from theano.gof import (utils, Op, view_roots,
local_optimizer, Optimizer, local_optimizer, Optimizer,
InconsistencyError, toolbox, SequenceDB, InconsistencyError, toolbox, SequenceDB,
......
...@@ -21,6 +21,7 @@ import numpy as N # guys... please don't do this in the library :( ...@@ -21,6 +21,7 @@ import numpy as N # guys... please don't do this in the library :(
import theano import theano
from theano import gof from theano import gof
from theano.compat.six.moves import reduce
from theano.gof import opt, InconsistencyError, TopoOptimizer, graph from theano.gof import opt, InconsistencyError, TopoOptimizer, graph
from theano.gof import Variable, Constant from theano.gof import Variable, Constant
from theano.compat import maxsize from theano.compat import maxsize
......
...@@ -8,6 +8,7 @@ import numpy ...@@ -8,6 +8,7 @@ import numpy
# local imports # local imports
import theano import theano
from theano.compat.six.moves import reduce
from theano import tensor from theano import tensor
from theano.tensor import opt from theano.tensor import opt
from theano import gof from theano import gof
......
...@@ -20,7 +20,7 @@ from numpy.testing.noseclasses import KnownFailureTest ...@@ -20,7 +20,7 @@ from numpy.testing.noseclasses import KnownFailureTest
from distutils.version import LooseVersion from distutils.version import LooseVersion
import theano import theano
from theano.compat import PY3, exc_message, operator_div from theano.compat import PY3, exc_message, operator_div, reduce
from theano.compat.six import StringIO from theano.compat.six import StringIO
from theano import compile, config, function, gof, tensor, shared from theano import compile, config, function, gof, tensor, shared
from theano.compile import DeepCopyOp from theano.compile import DeepCopyOp
......
from theano.tests.record import * from theano.tests.record import *
from theano import function from theano import function
from theano.compat.six.moves import xrange
from theano.tensor import iscalar from theano.tensor import iscalar
import cStringIO import cStringIO
......
...@@ -15,6 +15,7 @@ import theano ...@@ -15,6 +15,7 @@ import theano
import theano.tensor as T import theano.tensor as T
from theano import function, compat from theano import function, compat
from theano.compat.six.moves import xrange
from theano import config from theano import config
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
from theano.sandbox.rng_mrg import MRG_RandomStreams from theano.sandbox.rng_mrg import MRG_RandomStreams
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论