Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for fixing the six versus theano issue #1594

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pylearn2/compat.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Compatibility layer
"""
from theano.compat import six
import six


__all__ = ('OrderedDict', )
Expand Down
4 changes: 2 additions & 2 deletions pylearn2/config/tests/test_yaml_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import os
import numpy as np
from theano.compat import six
from theano.compat.six.moves import cPickle
import six
from six.moves import cPickle
import tempfile
from numpy.testing import assert_
from os import environ, close
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/config/yaml_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import warnings
import re

from theano.compat import six
import six

SCIENTIFIC_NOTATION_REGEXP = r'^[\-\+]?(\d+\.?\d*|\d*\.?\d+)?[eE][\-\+]?\d+$'

Expand Down
4 changes: 2 additions & 2 deletions pylearn2/costs/cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import logging
import warnings

from theano.compat.six.moves import reduce
from six.moves import reduce
import theano.tensor as T
from theano.compat.six.moves import zip as izip
from six.moves import zip as izip

from pylearn2.compat import OrderedDict
from pylearn2.utils import safe_zip
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/costs/dbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import operator
import warnings

from theano.compat.six.moves import reduce, xrange
from six.moves import reduce, xrange
from theano import config
from theano.sandbox.rng_mrg import MRG_RandomStreams
RandomStreams = MRG_RandomStreams
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/costs/ebm_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from theano import scan
import theano.tensor as T
from theano.compat.six.moves import zip as izip
from six.moves import zip as izip

from pylearn2.compat import OrderedDict
from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/costs/mlp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import theano
from theano import tensor as T
from theano.compat.six.moves import reduce
from six.moves import reduce

from pylearn2.costs.cost import Cost, DefaultDataSpecsMixin, NullDataSpecsMixin
from pylearn2.utils import safe_izip
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/cross_validation/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"

from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.blocks import StackedBlocks


Expand Down
2 changes: 1 addition & 1 deletion pylearn2/dataset_get/dataset-get.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import tarfile
import subprocess

from theano.compat.six.moves import input
from six.moves import input

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/dataset_get/helper-scripts/make-archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import logging
import os, sys, tarfile

from theano.compat.six.moves import input
from six.moves import input

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/binarized_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
__email__ = "pylearn-dev@googlegroups"

import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets.dense_design_matrix import (
DenseDesignMatrix,
DefaultViewConverter
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/cifar10.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging

import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange

from pylearn2.datasets import cache, dense_design_matrix
from pylearn2.expr.preprocessing import global_contrast_normalize
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/cifar100.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
import numpy as np
N = np
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets.dense_design_matrix import (DenseDesignMatrix,
DefaultViewConverter)
from pylearn2.utils import serial
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/dense_design_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import warnings

import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange

from pylearn2.datasets import cache
from pylearn2.utils.iteration import (
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pylearn2.utils.iteration import FiniteDatasetIterator
from pylearn2.utils.exc import reraise_as
from pylearn2.space import Space, CompositeSpace
from theano.compat.six import string_types
from six import string_types


class HDF5Dataset(Dataset):
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/hdf5_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
except ImportError:
h5py = None
import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange
import warnings

from pylearn2.datasets.dense_design_matrix import (DenseDesignMatrix,
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/hepatitis.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# http://archive.ics.uci.edu/ml/datasets/Hepatitis

import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange

from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import numpy as N
np = N
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets import dense_design_matrix
from pylearn2.datasets import control
from pylearn2.datasets import cache
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/norb_small.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
np = numpy
import os

from theano.compat.six.moves import reduce
from six.moves import reduce

from pylearn2.datasets import dense_design_matrix
from pylearn2.datasets import retina
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import warnings
import os
import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange
import scipy
try:
from scipy import linalg
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/retina.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
In *AISTATS* 2009.
"""
import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets.dense_design_matrix import DefaultViewConverter
from pylearn2.space import Conv2DSpace

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/stl10.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets import dense_design_matrix
from pylearn2.utils.serial import load
from pylearn2.utils import contains_nan
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/svhn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
warnings.warn("Couldn't import tables, so far SVHN is "
"only supported with PyTables")
import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange
from theano import config
from pylearn2.datasets import dense_design_matrix
from pylearn2.utils.serial import load
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/tests/test_norb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import unittest
import numpy
from theano.compat import six
import six
from pylearn2.datasets.norb import SmallNORB
from pylearn2.datasets.norb_small import FoveatedNORB
from pylearn2.datasets.new_norb import NORB
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/tl_challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as N
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets import cache, dense_design_matrix
from pylearn2.utils.string_utils import preprocess

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/transformer_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"

from theano.compat.six import Iterator
from six import Iterator

from pylearn2.datasets.dataset import Dataset
from pylearn2.space import CompositeSpace
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/utlc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
See the file ${PYLEARN2_DATA_PATH}/UTLC/README for details on the datasets.
"""

from theano.compat.six.moves import cPickle
from six.moves import cPickle
import gzip
import os

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/datasets/zca_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import logging
import warnings
import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.config import yaml_parse
from pylearn2.datasets import control
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/devtools/run_pyflakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import sys
import logging

from theano.compat import six
import six

from pylearn2.devtools.list_files import list_files
from pylearn2.utils.shell import run_shell_command
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/devtools/tests/docscrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re
import sys

from theano.compat import six
import six


class Reader(object):
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/energy_functions/tests/test_rbm_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
theano.config.compute_test_value = 'off'
from pylearn2.energy_functions.rbm_energy import GRBM_Type_1
import numpy as N
from theano.compat.six.moves import xrange
from six.moves import xrange
import theano.tensor as T
from theano import function
from pylearn2.utils import as_floatX
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"

from theano.compat.six.moves import xrange
from six.moves import xrange
import theano.tensor as T

from pylearn2.sandbox.cuda_convnet.response_norm import CrossMapNorm
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/probabilistic_max_pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import logging
import theano.tensor as T
import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange
from theano import config
from theano import function
import time
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/stochastic_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
__email__ = "mirzamom@iro"

import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange
import theano
from theano import tensor
from theano.gof.op import get_debug_values
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/tests/test_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import numpy as np

from theano.compat.six.moves import xrange
from six.moves import xrange

from pylearn2.expr.evaluation import all_pr

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/tests/test_normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
import warnings

from theano.compat.six.moves import xrange
from six.moves import xrange
from theano import config
from theano import function
import theano.tensor as T
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/tests/test_probabilistic_max_pooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import numpy as np
import warnings

from theano.compat.six.moves import xrange
from six.moves import xrange
from theano import config
from theano import function
import theano.tensor as T
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/expr/tests/test_stochastic_pool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections import Counter
import numpy
from theano.compat.six.moves import xrange
from six.moves import xrange
import theano
from pylearn2.expr.stochastic_pool import stochastic_max_pool_bc01, weighted_max_pool_bc01

Expand Down
2 changes: 1 addition & 1 deletion pylearn2/format/target_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from operator import mul

import numpy as np
from theano.compat.six.moves import reduce
from six.moves import reduce
import theano.sparse
if theano.sparse.enable_sparse:
scipy_available = True
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/gui/get_weights_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
import logging

from theano.compat.six.moves import input
from six.moves import input

from pylearn2.utils import serial
from pylearn2.gui import patch_viewer
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/gui/graph_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Classes for making simple 2D visualizations.
"""
import numpy as N
from theano.compat.six.moves import xrange
from six.moves import xrange
from theano import config


Expand Down
2 changes: 1 addition & 1 deletion pylearn2/gui/patch_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from __future__ import division

import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange
from pylearn2.datasets.dense_design_matrix import DefaultViewConverter
from pylearn2.utils.image import Image, ensure_Image
from pylearn2.utils.image import show
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/gui/tangent_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from matplotlib import pyplot
except Exception:
pyplot = None
from theano.compat.six.moves import xrange
from six.moves import xrange


def tangent_plot(x, y, s):
Expand Down
2 changes: 1 addition & 1 deletion pylearn2/linear/conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import functools
import numpy as np
from theano.compat.six.moves import xrange
from six.moves import xrange
import theano
import theano.tensor as T
from theano.tensor.nnet.conv import conv2d
Expand Down
Loading