提交 9b0c950a authored 作者: AdeB's avatar AdeB

Remove unused imports

上级 325ce519
...@@ -23,8 +23,7 @@ from six import string_types, iteritems, itervalues ...@@ -23,8 +23,7 @@ from six import string_types, iteritems, itervalues
from six.moves import StringIO, xrange from six.moves import StringIO, xrange
from theano.gof import (graph, utils, link, ops_with_inner_function) from theano.gof import (graph, utils, link, 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, IntParam, StrParam)
StrParam)
from theano.compile.function_module import ( from theano.compile.function_module import (
FunctionMaker, Function, infer_reuse_pattern, FunctionMaker, Function, infer_reuse_pattern,
SymbolicInputKit, SymbolicOutput, Supervisor, std_fgraph) SymbolicInputKit, SymbolicOutput, Supervisor, std_fgraph)
......
...@@ -10,7 +10,7 @@ import numpy ...@@ -10,7 +10,7 @@ import numpy
import theano import theano
from theano import gof from theano import gof
import theano.gof.vm import theano.gof.vm
from theano.configparser import config, AddConfigVar, StrParam from theano.configparser import config
from theano.compile.ops import _output_guard from theano.compile.ops import _output_guard
from six import string_types from six import string_types
......
...@@ -6,7 +6,7 @@ from six.moves import StringIO ...@@ -6,7 +6,7 @@ from six.moves import StringIO
import numpy as np import numpy as np
import theano import theano
from theano.configparser import config, AddConfigVar, BoolParam, EnumStr from theano.configparser import config
import theano.tensor as T import theano.tensor as T
import theano.sandbox.cuda as cuda import theano.sandbox.cuda as cuda
from theano.compile import Mode from theano.compile import Mode
......
...@@ -11,7 +11,7 @@ from six import string_types, iteritems, itervalues ...@@ -11,7 +11,7 @@ from six import string_types, iteritems, itervalues
from theano.compile.mode import (Mode, register_mode, from theano.compile.mode import (Mode, register_mode,
predefined_modes, predefined_linkers, predefined_modes, predefined_linkers,
predefined_optimizers) predefined_optimizers)
from theano.configparser import config, AddConfigVar, IntParam, BoolParam from theano.configparser import config
from theano.compile.function_module import FunctionMaker from theano.compile.function_module import FunctionMaker
from .profiling import ProfileStats from .profiling import ProfileStats
......
...@@ -1143,19 +1143,19 @@ AddConfigVar('scan.allow_output_prealloc', ...@@ -1143,19 +1143,19 @@ AddConfigVar('scan.allow_output_prealloc',
BoolParam(True)) BoolParam(True))
AddConfigVar('pycuda.init', AddConfigVar('pycuda.init',
"""If True, always initialize PyCUDA when Theano want to """If True, always initialize PyCUDA when Theano want to
initilize the GPU. Currently, we must always initialize initilize the GPU. Currently, we must always initialize
PyCUDA before Theano do it. Setting this flag to True, PyCUDA before Theano do it. Setting this flag to True,
ensure that, but always import PyCUDA. It can be done ensure that, but always import PyCUDA. It can be done
manually by importing theano.misc.pycuda_init before theano manually by importing theano.misc.pycuda_init before theano
initialize the GPU device. initialize the GPU device.
""", """,
BoolParam(False), BoolParam(False),
in_c_key=False) in_c_key=False)
AddConfigVar('cublas.lib', AddConfigVar('cublas.lib',
"""Name of the cuda blas library for the linker.""", """Name of the cuda blas library for the linker.""",
StrParam('cublas')) StrParam('cublas'))
AddConfigVar('lib.cnmem', AddConfigVar('lib.cnmem',
"""Do we enable CNMeM or not (a faster CUDA memory allocator). """Do we enable CNMeM or not (a faster CUDA memory allocator).
...@@ -1327,6 +1327,7 @@ AddConfigVar("compiledir_format", ...@@ -1327,6 +1327,7 @@ AddConfigVar("compiledir_format",
StrParam(default_compiledir_format, allow_override=False), StrParam(default_compiledir_format, allow_override=False),
in_c_key=False) in_c_key=False)
def default_compiledirname(): def default_compiledirname():
formatted = theano.config.compiledir_format % compiledir_format_dict formatted = theano.config.compiledir_format % compiledir_format_dict
safe = re.sub("[\(\)\s,]+", "_", formatted) safe = re.sub("[\(\)\s,]+", "_", formatted)
...@@ -1417,6 +1418,7 @@ AddConfigVar( ...@@ -1417,6 +1418,7 @@ AddConfigVar(
allow_override=False), allow_override=False),
in_c_key=False) in_c_key=False)
def default_compiledir(): def default_compiledir():
return os.path.join( return os.path.join(
theano.config.base_compiledir, theano.config.base_compiledir,
...@@ -1425,7 +1427,7 @@ def default_compiledir(): ...@@ -1425,7 +1427,7 @@ def default_compiledir():
AddConfigVar( AddConfigVar(
'compiledir', 'compiledir',
"platform-dependent cache directory for compiled modules", "platform-dependent cache directory for compiled modules",
ConfigParam( ConfigParam(
default_compiledir, default_compiledir,
filter=filter_compiledir, filter=filter_compiledir,
......
...@@ -20,11 +20,6 @@ from theano.compat import izip ...@@ -20,11 +20,6 @@ from theano.compat import izip
from six import string_types, reraise from six import string_types, reraise
from six.moves import StringIO, xrange from six.moves import StringIO, xrange
# Note that we need to do this before importing cutils, since when there is
# no theano cache dir initialized yet, importing cutils may require compilation
# of cutils_ext.
from theano.configparser import AddConfigVar, StrParam
# gof imports # gof imports
from theano.gof import graph from theano.gof import graph
from theano.gof import link from theano.gof import link
......
...@@ -34,8 +34,6 @@ from theano.misc.windows import (subprocess_Popen, ...@@ -34,8 +34,6 @@ from theano.misc.windows import (subprocess_Popen,
from theano.gof import compilelock from theano.gof import compilelock
from theano.configdefaults import gcc_version_str, local_bitwidth from theano.configdefaults import gcc_version_str, local_bitwidth
from theano.configparser import AddConfigVar, BoolParam
importlib = None importlib = None
try: try:
import importlib import importlib
......
...@@ -10,7 +10,6 @@ import theano ...@@ -10,7 +10,6 @@ import theano
from six import string_types, iteritems from six import string_types, iteritems
from theano.configparser import config from theano.configparser import config
from theano.gof.utils import flatten from theano.gof.utils import flatten
from theano.misc.windows import output_subprocess_Popen
_logger = logging.getLogger("theano.gof.compiledir") _logger = logging.getLogger("theano.gof.compiledir")
......
...@@ -12,7 +12,6 @@ from contextlib import contextmanager ...@@ -12,7 +12,6 @@ from contextlib import contextmanager
import numpy as np import numpy as np
from theano import config from theano import config
from theano.configparser import AddConfigVar, IntParam
random = np.random.RandomState([2015, 8, 2]) random = np.random.RandomState([2015, 8, 2])
......
...@@ -2,13 +2,10 @@ from __future__ import print_function ...@@ -2,13 +2,10 @@ from __future__ import print_function
import copy import copy
import sys import sys
import numpy
from theano.compat import DefaultOrderedDict from theano.compat import DefaultOrderedDict
from theano.misc.ordered_set import OrderedSet from theano.misc.ordered_set import OrderedSet
from six import StringIO from six import StringIO
from theano.gof import opt from theano.gof import opt
from theano.configparser import AddConfigVar, FloatParam
from theano import config from theano import config
......
from theano.gof.compiledir import short_platform from theano.configdefaults import short_platform
def test_short_platform(): def test_short_platform():
......
...@@ -13,8 +13,7 @@ import sys ...@@ -13,8 +13,7 @@ import sys
import time import time
import warnings import warnings
from theano.configparser import (config, AddConfigVar, from theano.configparser import (config, _config_var_list)
BoolParam, ConfigParam, _config_var_list)
import theano.gof.cmodule import theano.gof.cmodule
......
...@@ -14,7 +14,6 @@ import numpy ...@@ -14,7 +14,6 @@ import numpy
import theano import theano
from theano import config, gof, printing, scalar from theano import config, gof, printing, scalar
from theano.compat import imap from theano.compat import imap
from theano.configparser import AddConfigVar, BoolParam
from theano.printing import pprint from theano.printing import pprint
from theano.tensor import basic as tensor from theano.tensor import basic as tensor
from theano.tensor import elemwise, opt, NotScalarConstantError from theano.tensor import elemwise, opt, NotScalarConstantError
......
...@@ -1596,6 +1596,7 @@ local_elemwise_alloc = register_specialize( ...@@ -1596,6 +1596,7 @@ local_elemwise_alloc = register_specialize(
local_elemwise_alloc_op(T.Elemwise, T.Alloc, T.DimShuffle)), local_elemwise_alloc_op(T.Elemwise, T.Alloc, T.DimShuffle)),
'local_alloc_elemwise') 'local_alloc_elemwise')
@gof.local_optimizer([T.Elemwise]) @gof.local_optimizer([T.Elemwise])
def local_fill_sink(node): def local_fill_sink(node):
""" """
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论