提交 555ca75c authored 作者: lamblin's avatar lamblin

Merge pull request #1218 from abalkin/remove-unused-imports

Issue #783: python3 compatible - remove unnecessary imports.
......@@ -5,7 +5,7 @@
"""
__docformat__ = "restructuredtext en"
import time, copy, sys, copy_reg, gc, os
import copy, sys, copy_reg, gc
from itertools import izip
from StringIO import StringIO
......
......@@ -3,13 +3,10 @@
__docformat__ = "restructuredtext en"
import logging
import sys
import traceback
_logger = logging.getLogger('theano.compile.function')
from io import In
from function_module import orig_function
from profiling import ProfileStats
from pfunc import pfunc
from numpy import any # to work in python 2.4
import warnings
......
......@@ -9,7 +9,7 @@ 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.gof import Container, Variable, generic, graph, Constant
from theano.gof import Variable, Constant
from theano.gof.python25 import any
import logging
......
import cPickle, logging, sys
import cPickle, logging
_logger=logging.getLogger("theano.gof.callcache")
......
......@@ -2,7 +2,6 @@
# same compilation directory (which can cause crashes).
from theano import config
import compiledir
import os, random, time, atexit
import socket # only used for gethostname()
import logging
......
......@@ -2,12 +2,6 @@
Classes and functions for validating graphs that contain view
and inplace operations.
"""
import sys
if sys.version_info[:2] >= (2,5):
from collections import defaultdict
# otherwise it's implemented in python25.py
import theano
import toolbox
import graph
......
......@@ -12,7 +12,6 @@ from python25 import all
from theano import config
import warnings
NullType = None
import theano
from python25 import OrderedDict
from theano.misc.ordered_set import OrderedSet
......
......@@ -2,11 +2,9 @@
__docformat__ = "restructuredtext en"
import copy
import utils
from utils import MethodNotDefined, object2
import graph
from theano import config
########
# Type #
......
......@@ -3,7 +3,7 @@
# import variable
from theano import config
import re, os, traceback
import re, traceback
def add_tag_trace(thing):
"""Add tag.trace to an node or variable.
......
......@@ -21,10 +21,8 @@ from itertools import izip
from theano import gof
from theano.gof import Variable
from theano.gof.python25 import OrderedDict
from theano.gof.python25 import all
import theano.gof.utils
from theano.gof.null_type import NullType
from theano.printing import min_informative_str
# we can't do "import theano.tensor"
# tensor depends on theano.compile
# theano.compile depends on theano.gradient (this file)
......
# This is work in progress
import theano
from theano import Op, Apply
import theano.tensor as T
from theano.gof import local_optimizer
from theano.sandbox.cuda import cuda_available, GpuOp
......
import numpy
import theano
from theano.gof import Op, Apply
from theano import tensor
......
......@@ -12,7 +12,7 @@ from theano.tensor.opt import (register_stabilize,
register_specialize, register_canonicalize)
from theano.gof import local_optimizer
from theano.gof.opt import Optimizer
from theano.gradient import grad_not_implemented, DisconnectedType
from theano.gradient import DisconnectedType
try:
import scipy.linalg
......
......@@ -12,27 +12,18 @@ __authors__ = ("Razvan Pascanu "
__copyright__ = "(c) 2010, Universite de Montreal"
__contact__ = "Razvan Pascanu <r.pascanu@gmail>"
import itertools
import logging
import time
from itertools import izip
import numpy
import theano
from theano.compile import function, Param, Out
from theano import compile
from theano import gradient
from theano.gof.python25 import any
from theano.gof import PureOp, Apply
from theano import gof
from theano.tensor import TensorType
from theano import tensor
from theano.tensor.opt import Shape_i
#from theano.sandbox import cuda
from theano.compile.profiling import ScanProfileStats
import scan_utils
# Logging function for sending warning or info
_logger = logging.getLogger('theano.scan_module.scan_op')
......
......@@ -22,7 +22,7 @@ __contact__ = "theano-dev <theano-dev@googlegroups.com>"
__docformat__ = "restructuredtext en"
import numpy
from theano.compile import shared_constructor, SharedVariable
from theano.compile import SharedVariable
from basic import Scalar, _scalar_py_operators
class ScalarSharedVariable(_scalar_py_operators, SharedVariable):
......
import theano
import numpy
import math
from theano import gof, tensor, function, scalar
from theano.sandbox.linalg.ops import diag
from theano import gof, tensor
class Fourier(gof.Op):
......
from basic import _scal_elemwise #, _transpose_inplace
from theano import scalar as scal
import elemwise
from theano import printing
from theano.printing import pprint
from theano.gof.python25 import any
def _scal_inplace(symbol):
"""Replace a symbol definition with an elementwise version of the corresponding scalar Op"""
......
......@@ -28,16 +28,10 @@ Also, we should make the fgraph refuse optimization that break the canonization
import logging
_logger = logging.getLogger('theano.tensor.opt')
import operator
import itertools
import sys
import theano
from theano import gof
from elemwise import CAReduce
import basic as T
from theano.gof.python25 import any, all
from theano.gof.opt import Optimizer
from theano.gof import InconsistencyError, toolbox
......
......@@ -4,11 +4,8 @@ graphs.
__docformat__ = "restructuredtext en"
import copy
import sys
import numpy
from theano.gof import Container
from theano.compile.sharedvalue import (SharedVariable, shared_constructor,
shared)
import raw_random
......
......@@ -5,11 +5,7 @@ generic 2D convolution.
__docformat__ = "restructuredtext en"
import numpy
import theano
import theano.tensor as tensor
import theano.tensor.nnet as nnet
from theano import gof, Op, tensor, config
from theano.tensor.nnet import conv
import logging
......
import theano
import numpy
from elemwise import Elemwise
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论