提交 6cf6323c authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Apply isort to theano.compile sub-package modules

上级 bfcd85cc
from theano.compile.builders import *
from theano.compile.debugmode import DebugMode
from theano.compile.function import function, function_dump
from theano.compile.function_module import *
from theano.compile.io import *
from theano.compile.mode import *
from theano.compile.monitormode import MonitorMode
from theano.compile.ops import (
DeepCopyOp,
deep_copy_op,
register_deep_copy_op_c_code,
FromFunctionOp,
Rebroadcast,
Shape,
shape,
register_shape_c_code,
Shape_i,
register_shape_i_c_code,
SpecifyShape,
ViewOp,
view_op,
register_view_op_c_code,
FromFunctionOp,
as_op,
Rebroadcast,
deep_copy_op,
register_deep_copy_op_c_code,
register_rebroadcast_c_code,
SpecifyShape,
specify_shape,
register_shape_c_code,
register_shape_i_c_code,
register_specify_shape_c_code,
register_view_op_c_code,
shape,
specify_shape,
view_op,
)
from theano.compile.function_module import *
from theano.compile.mode import *
from theano.compile.io import *
from theano.compile.debugmode import DebugMode
from theano.compile.monitormode import MonitorMode
from theano.compile.pfunc import Param, pfunc, rebuild_collect_shared
from theano.compile.profiling import ProfileStats, ScanProfileStats
from theano.compile.sharedvalue import shared, shared_constructor, SharedVariable
from theano.compile.pfunc import pfunc, Param, rebuild_collect_shared
from theano.compile.builders import *
from theano.compile.function import function, function_dump
from theano.compile.sharedvalue import SharedVariable, shared, shared_constructor
"""Define new Ops from existing Ops"""
from functools import reduce, partial
from collections import OrderedDict
from functools import partial, reduce
import theano
from theano import gof
from theano.compile.function_module import orig_function
from theano.compile import SharedVariable, rebuild_collect_shared, optdb
from theano.compile.mode import optdb
from theano.compile.pfunc import rebuild_collect_shared
from theano.compile.sharedvalue import SharedVariable
from theano.gof import Variable, ops_with_inner_function
from theano.gof.graph import io_connection_pattern
from theano.gof.null_type import NullType
......
......@@ -7,32 +7,28 @@ TODO: add support for IfElse Op, LazyLinker, PureOp, etc.
import copy
import sys
import gc
import logging
import sys
from itertools import chain
from itertools import product as itertools_product
import numpy as np
import theano
from itertools import chain, product as itertools_product
from six.moves import StringIO
from theano import gof, config
import theano
from theano import change_flags, config, gof
from theano.compat import get_unbound_function
from theano.gof import graph, utils, link, ops_with_inner_function
from theano.gof.link import raise_with_op
from theano.compile.function_module import (
FunctionMaker,
Function,
FunctionMaker,
infer_reuse_pattern,
std_fgraph,
)
from theano.compile.mode import Mode, register_mode
from theano.compile.ops import OutputGuard, _output_guard
from theano import change_flags
from theano.gof import graph, link, ops_with_inner_function, utils
from theano.gof.link import raise_with_op
__docformat__ = "restructuredtext en"
......@@ -1197,8 +1193,8 @@ def _get_preallocated_maps(
"""
# To avoid circular imports
from theano.tensor import TensorType
from theano.gpuarray import GpuArrayType
from theano.tensor import TensorType
try:
import pygpu
......
......@@ -5,15 +5,16 @@ Define the `function` function.
import logging
import traceback as tb
import re
import traceback as tb
import warnings
from six import string_types
from theano import compat
from theano.compile.function_module import orig_function
from theano.compile.pfunc import pfunc
import warnings
from theano import compat
__docformat__ = "restructuredtext en"
_logger = logging.getLogger("theano.compile.function")
......
......@@ -4,28 +4,25 @@ Driver of graph construction, optimization, and linking.
"""
import copy
import time
import logging
import time
import warnings
from itertools import chain
import numpy as np
import six.moves.copyreg as copyreg
import six.moves.cPickle as pickle
import numpy as np
from six import string_types
import theano
import theano.compile.profiling
from itertools import chain
from six import string_types
from theano import config, gof
from theano.gof import graph
from theano.compile.io import In, SymbolicInput, SymbolicOutput
from theano.compile.ops import deep_copy_op, view_op
from theano.gof.toolbox import is_same_graph
from theano.gof import graph
from theano.gof.op import ops_with_inner_function
from theano.gof.toolbox import is_same_graph
_logger = logging.getLogger("theano.compile.function_module")
......@@ -1369,9 +1366,10 @@ class FunctionMaker(object):
def optimize_graph_with_cache(self, optimizer, inputs, outputs):
# This function is not finished
from theano.gof.compilelock import get_lock, release_lock
import os.path
from theano.gof.compilelock import get_lock, release_lock
graph_db_file = os.path.join(theano.config.compiledir, "optimized_graphs.pkl")
# the inputs, outputs, and size of the graph to be optimized
......
......@@ -4,12 +4,14 @@ Define `SymbolicInput`, `SymbolicOutput`, `In`, `Out`.
"""
from theano import gof
from .sharedvalue import SharedVariable
import logging
from six import string_types
import logging
from theano import gof
from .sharedvalue import SharedVariable
_logger = logging.getLogger("theano.compile.io")
......
......@@ -6,15 +6,15 @@ WRITEME
import logging
import warnings
import theano
import theano.gof.vm
from six import string_types
import theano
import theano.gof.vm
from theano import config, gof
from theano.compile.function_module import Supervisor
from theano.sandbox.jax_linker import JAXLinker
_logger = logging.getLogger("theano.compile.mode")
......
import logging
import numpy as np
from six.moves import StringIO
import theano
import theano.tensor as tt
from six.moves import StringIO
from theano import config
from theano.compat import ValuesView
from theano.compile.mode import get_mode, Mode
from theano.compile.mode import Mode, get_mode
try:
from theano.gpuarray.type import GpuArrayType, _name_for_ctx
from pygpu.gpuarray import GpuArray
from theano.gpuarray.type import GpuArrayType, _name_for_ctx
pygpu_available = True
except ImportError:
pygpu_available = False
......
......@@ -7,18 +7,14 @@ help make new Ops more rapidly.
import copy
import warnings
import six.moves.cPickle as pickle
import numpy as np
import theano
from collections import OrderedDict
import numpy as np
import six.moves.cPickle as pickle
from six import integer_types
from theano.gof import Op, Apply, ParamsType, Variable
import theano
from theano.gof import Apply, Op, ParamsType, Variable
def register_view_op_c_code(type, code, version=()):
......
......@@ -3,16 +3,16 @@ Provide a simple user friendly API.
"""
import warnings
import logging
import warnings
from theano import config
from theano.compile import orig_function, In, Out
from theano.compile import UnusedInputError
from theano.compile.sharedvalue import SharedVariable, shared
from theano.compile.function_module import UnusedInputError, orig_function
from theano.compile.io import In, Out
from theano.compile.profiling import ProfileStats
from theano.gof import Variable, Constant
from theano.compile.sharedvalue import SharedVariable, shared
from theano.gof import Constant, Variable
_logger = logging.getLogger("theano.compile.pfunc")
......
......@@ -16,13 +16,11 @@ import os
import sys
import time
import warnings
from collections import defaultdict
import numpy as np
import theano
from collections import defaultdict
from theano.gof import graph
......@@ -1701,9 +1699,9 @@ class ProfileStats(object):
printed_tip = True
# tip 7
from theano.tensor.nnet import LogSoftmax
import theano.tensor.signal.pool as pool
import theano.gpuarray
import theano.tensor.signal.pool as pool
from theano.tensor.nnet import LogSoftmax
for a in self.apply_time:
node = a
......
......@@ -14,6 +14,7 @@ import numpy as np
# Theano imports
from theano.gof import Container, Variable, generic, utils
_logger = logging.getLogger("theano.compile.sharedvalue")
__docformat__ = "restructuredtext en"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论