提交 50ec34d6 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Apply isort to theano.misc sub-package modules

上级 6796db42
...@@ -8,7 +8,6 @@ import numpy as np ...@@ -8,7 +8,6 @@ import numpy as np
import theano import theano
import theano.tensor as tt import theano.tensor as tt
from theano.gpuarray import dnn from theano.gpuarray import dnn
from theano.tensor.nnet.abstract_conv import get_conv_output_shape from theano.tensor.nnet.abstract_conv import get_conv_output_shape
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
import os import os
import sys import sys
import time import time
from optparse import OptionParser
import numpy as np import numpy as np
import theano import theano
import theano.tensor as tt import theano.tensor as tt
from optparse import OptionParser
def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, iters=10, order="C"): def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, iters=10, order="C"):
""" """
......
import six.moves.cPickle as pickle
import os import os
import sys import sys
import six.moves.cPickle as pickle
import theano import theano
......
#!/bin/env python #!/bin/env python
# Import smtplib for the actual sending function # Import smtplib for the actual sending function
import smtplib
import os.path import os.path
import smtplib
import sys import sys
from theano.misc.buildbot_filter import filter_output from theano.misc.buildbot_filter import filter_output
# me == the sender's email address # me == the sender's email address
# family = the list of all recipients' email addresses # family = the list of all recipients' email addresses
family=['theano-buildbot@googlegroups.com'] family=['theano-buildbot@googlegroups.com']
...@@ -33,9 +36,11 @@ else: ...@@ -33,9 +36,11 @@ else:
files=[os.path.join('/tmp', x) for x in files] files=[os.path.join('/tmp', x) for x in files]
print('path', files) print('path', files)
from email.mime.multipart import MIMEMultipart
# Here are the email package modules we'll need # Here are the email package modules we'll need
from email.mime.text import MIMEText from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
COMMASPACE = ', ' COMMASPACE = ', '
......
import os import os
import subprocess import subprocess
import sys import sys
from optparse import OptionParser
from locale import getpreferredencoding from locale import getpreferredencoding
from optparse import OptionParser
import theano import theano
from theano.compat import decode_with from theano.compat import decode_with
console_encoding = getpreferredencoding() console_encoding = getpreferredencoding()
parser = OptionParser( parser = OptionParser(
......
import sys import sys
import time import time
from optparse import OptionParser
import numpy as np import numpy as np
import theano import theano
import theano.tensor as tt import theano.tensor as tt
from optparse import OptionParser
parser = OptionParser( parser = OptionParser(
usage="%prog <options>\n Compute time for" " fast and slow elemwise operations" usage="%prog <options>\n Compute time for" " fast and slow elemwise operations"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
import collections import collections
import operator
import functools import functools
import operator
from theano.compat import Mapping from theano.compat import Mapping
......
...@@ -6,10 +6,12 @@ try: ...@@ -6,10 +6,12 @@ try:
except NameError: except NameError:
pass pass
import requests
import getpass import getpass
import json import json
import requests
# Keyring stores passwords by a 'username', but we're not storing a username and # Keyring stores passwords by a 'username', but we're not storing a username and
# password # password
fake_username = "ipython_tools" fake_username = "ipython_tools"
......
...@@ -7,10 +7,11 @@ import difflib ...@@ -7,10 +7,11 @@ import difflib
import operator import operator
import os import os
import string import string
from subprocess import Popen, PIPE
import sys import sys
import tabnanny import tabnanny
import tokenize import tokenize
from subprocess import PIPE, Popen
try: try:
import argparse import argparse
...@@ -24,6 +25,7 @@ except ImportError: ...@@ -24,6 +25,7 @@ except ImportError:
import reindent import reindent
from six import StringIO from six import StringIO
SKIP_WHITESPACE_CHECK_FILENAME = ".hg/skip_whitespace_check" SKIP_WHITESPACE_CHECK_FILENAME = ".hg/skip_whitespace_check"
......
...@@ -42,10 +42,10 @@ you'd prefer. You can always use the --nobackup option to prevent this. ...@@ -42,10 +42,10 @@ you'd prefer. You can always use the --nobackup option to prevent this.
__version__ = "1" __version__ = "1"
import tokenize
import os import os
import shutil import shutil
import sys import sys
import tokenize
verbose = 0 verbose = 0
......
...@@ -4,6 +4,7 @@ import numpy as np ...@@ -4,6 +4,7 @@ import numpy as np
import theano import theano
y = theano.tensor.fvector() y = theano.tensor.fvector()
x = theano.shared(np.zeros(1, dtype="float32")) x = theano.shared(np.zeros(1, dtype="float32"))
f1 = theano.function([y], updates={x: y}) f1 = theano.function([y], updates={x: y})
......
...@@ -5,10 +5,13 @@ numpy version support only ndarray. ...@@ -5,10 +5,13 @@ numpy version support only ndarray.
import numpy as np import numpy as np
from theano.tensor.basic import TensorType from theano.tensor.basic import TensorType
try: try:
import scipy.sparse import scipy.sparse
from theano.sparse.basic import SparseType from theano.sparse.basic import SparseType
def _is_sparse(a): def _is_sparse(a):
...@@ -23,6 +26,7 @@ except ImportError: ...@@ -23,6 +26,7 @@ except ImportError:
from theano import gpuarray from theano import gpuarray
if gpuarray.pygpu: if gpuarray.pygpu:
def _is_gpua(a): def _is_gpua(a):
......
import types import types
import weakref import weakref
from collections.abc import MutableSet from collections.abc import MutableSet
from six import string_types from six import string_types
......
...@@ -5,21 +5,22 @@ These pickled graphs can be used, for instance, as cases for ...@@ -5,21 +5,22 @@ These pickled graphs can be used, for instance, as cases for
unit tests or regression tests. unit tests or regression tests.
""" """
import numpy as np
import os import os
import pickle import pickle
import sys import sys
import tempfile import tempfile
import zipfile
import warnings import warnings
import zipfile
import theano
from collections import defaultdict from collections import defaultdict
from contextlib import closing from contextlib import closing
from pickle import HIGHEST_PROTOCOL from pickle import HIGHEST_PROTOCOL
import numpy as np
from six import BytesIO from six import BytesIO
import theano
try: try:
from pickle import DEFAULT_PROTOCOL from pickle import DEFAULT_PROTOCOL
except ImportError: except ImportError:
...@@ -28,6 +29,7 @@ except ImportError: ...@@ -28,6 +29,7 @@ except ImportError:
from theano import config from theano import config
from theano.compile.sharedvalue import SharedVariable from theano.compile.sharedvalue import SharedVariable
__docformat__ = "restructuredtext en" __docformat__ = "restructuredtext en"
__authors__ = "Pascal Lamblin" __authors__ = "Pascal Lamblin"
__copyright__ = "Copyright 2013, Universite de Montreal" __copyright__ = "Copyright 2013, Universite de Montreal"
...@@ -212,8 +214,8 @@ class PersistentNdarrayLoad(object): ...@@ -212,8 +214,8 @@ class PersistentNdarrayLoad(object):
self.cache = {} self.cache = {}
def __call__(self, persid): def __call__(self, persid):
from theano.gpuarray.type import get_context
from theano.gpuarray import pygpu from theano.gpuarray import pygpu
from theano.gpuarray.type import get_context
array_type, name = persid.split(".") array_type, name = persid.split(".")
......
...@@ -7,6 +7,7 @@ import numpy as np ...@@ -7,6 +7,7 @@ import numpy as np
import theano import theano
__docformat__ = "restructuredtext en" __docformat__ = "restructuredtext en"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论