提交 7ace6b70 authored 作者: Roman Ring's avatar Roman Ring

remove python2x.py, fix imports associated with it

上级 938dbc86
......@@ -58,8 +58,7 @@ else:
cmp = cmp
# Older Python 2.x compatibility
from theano.compat.python2x import DictMixin, OrderedDict
from collections import OrderedDict, MutableMapping as DictMixin
def decode(x):
return x
......
"""
Helper functions to make theano backwards compatible with python 2.6 - 2.7
Now mostly there for compatibility as we don't support Python 2.6 anymore.
"""
from __future__ import absolute_import, print_function, division
try:
from UserDict import DictMixin
except ImportError:
from collections import MutableMapping as DictMixin
from collections import OrderedDict, Counter
__all__ = ['DictMixin', 'OrderedDict', 'Counter']
......@@ -5,6 +5,7 @@ help make new Ops more rapidly.
"""
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
import copy
import six.moves.cPickle as pickle
......@@ -12,7 +13,6 @@ import warnings
import theano
from theano import gof
from theano.compat import OrderedDict
from six import iteritems, integer_types
from six.moves import xrange
......
......@@ -5,14 +5,13 @@ and inplace operations.
"""
from __future__ import absolute_import, print_function, division
from collections import deque
from collections import deque, OrderedDict
from six import iteritems
import theano
from . import toolbox
from . import graph
from theano.compat import OrderedDict
from theano.misc.ordered_set import OrderedSet
from .fg import InconsistencyError
......
......@@ -5,6 +5,7 @@ types that it can raise.
"""
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
import sys
import time
import traceback
......@@ -15,7 +16,6 @@ from theano.gof import utils
from theano.gof import toolbox
from theano import config
from theano.compat import OrderedDict
from six import iteritems, itervalues
from six.moves import StringIO
from theano.misc.ordered_set import OrderedSet
......
......@@ -5,7 +5,7 @@ amount of useful generic optimization tools.
"""
from __future__ import absolute_import, print_function, division
from collections import deque, defaultdict
from collections import deque, defaultdict, OrderedDict
import copy
import inspect
import logging
......@@ -19,7 +19,7 @@ import numpy
import theano
from theano import config
from theano.compat import izip, OrderedDict
from theano.compat import izip
from six import string_types, iteritems, itervalues, integer_types
from six.moves import reduce
from theano.gof import graph, op, utils, unify, toolbox
......
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
import theano
from theano.compat import OrderedDict
from theano.gof.utils import (
give_variables_names, hash_from_dict, remove, unique)
......
from __future__ import absolute_import, print_function, division
from functools import partial
from collections import OrderedDict
import sys
import time
import inspect
import theano
from theano import config
from theano.compat import OrderedDict
from theano.gof import graph
......
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
import linecache
import sys
import traceback
......@@ -8,7 +9,7 @@ from six import iteritems, integer_types, string_types, with_metaclass
from six.moves import StringIO
from theano import config
from theano.compat import OrderedDict, PY3
from theano.compat import PY3
def simple_extract_stack(f=None, limit=None, skips=[]):
......
"""Driver for gradient calculations."""
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
import six.moves.builtins as builtins
import logging
import time
......@@ -12,7 +13,7 @@ import theano
from theano import gof
from theano.gof import utils, Variable
from theano.compat import OrderedDict, izip
from theano.compat import izip
from six.moves import xrange, reduce
from theano.gof.null_type import NullType, null_type
from theano.gof.op import get_debug_values
......
......@@ -47,6 +47,7 @@ __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import logging
import numpy
import warnings
from collections import OrderedDict
from theano.compat import ifilter, izip
from six import iteritems, integer_types
......@@ -59,7 +60,6 @@ from theano import tensor
from theano import config
from theano.updates import OrderedUpdates
from theano.compile import ops
from theano.compat import OrderedDict
from theano.scan_module import scan_op
......
......@@ -60,6 +60,7 @@ import copy
import itertools
import logging
import time
from collections import OrderedDict
import numpy
from six import iteritems, integer_types
......@@ -73,7 +74,7 @@ from theano import compile, config, gradient, gof, tensor
from theano.gof import PureOp, Apply
from theano.gof.graph import io_connection_pattern
from theano.gof.toolbox import NoOutputFromInplace
from theano.compat import OrderedDict, izip
from theano.compat import izip
from theano.tensor import TensorType
from theano.tensor.opt import Shape_i
from theano.gradient import grad_undefined, DisconnectedType, NullType
......
......@@ -53,13 +53,13 @@ from __future__ import absolute_import, print_function, division
import logging
import copy
from sys import maxsize
from collections import OrderedDict
import numpy
import theano
from theano import tensor, scalar
from theano.tensor import opt, get_scalar_constant_value, Alloc, AllocEmpty
from theano import gof
from theano.compat import OrderedDict
from six import integer_types, iteritems
from six.moves import xrange
from theano.compile import optdb
......
......@@ -18,6 +18,7 @@ __contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import copy
import logging
import warnings
from collections import OrderedDict
import numpy
......@@ -28,7 +29,6 @@ from six.moves import xrange
from theano.compile.pfunc import rebuild_collect_shared
from theano import gof, compat
from theano import tensor, scalar
from theano.compat import OrderedDict
from theano.tensor.basic import get_scalar_constant_value
......
......@@ -7,6 +7,7 @@ from tempfile import mkdtemp
import time
import unittest
import copy
from collections import OrderedDict
import six.moves.cPickle as pickle
from six.moves import xrange
......@@ -23,7 +24,7 @@ from theano.compile.pfunc import rebuild_collect_shared
from theano.tests import unittest_tools as utt
import theano.scalar.sharedvar
from theano.scan_module.scan_op import Scan
from theano.compat import PY3, OrderedDict
from theano.compat import PY3
from theano.tests.unittest_tools import attr
......
......@@ -7,11 +7,11 @@ from __future__ import absolute_import, print_function, division
__docformat__ = 'restructedtext en'
from collections import OrderedDict
import numpy
import theano
import theano.tensor as T
from theano.compat import OrderedDict
def gen_data():
......
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
from theano.tests.record import RecordMode, Record
from theano.compat import OrderedDict
from theano.tests import disturb_mem
import numpy as np
import theano
......
from __future__ import absolute_import, print_function, division
from collections import OrderedDict
#
# UNIT TEST
#
......@@ -9,7 +10,7 @@ from six.moves import xrange
import theano
from theano import gof
from theano.compat import OrderedDict, izip
from theano.compat import izip
from theano.tests import unittest_tools as utt
from theano import gradient
......
......@@ -13,9 +13,9 @@ The config option is in configdefaults.py
This note is written by Li Yao.
"""
from collections import OrderedDict
import numpy
import six.moves.cPickle as pickle
from theano.compat import OrderedDict
import theano
import theano.tensor as T
......
......@@ -2,7 +2,7 @@
"""
from __future__ import absolute_import, print_function, division
from theano.compat import OrderedDict
from collections import OrderedDict
from six import iteritems
from theano.compile.sharedvalue import SharedVariable
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论