提交 7029d8c0 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Apply isort to theano.sandbox sub-package modules

上级 50ec34d6
import warnings import warnings
from theano.tensor.nnet.blocksparse import ( from theano.tensor.nnet.blocksparse import (
SparseBlockGemv, SparseBlockGemv,
SparseBlockOuter, SparseBlockOuter,
...@@ -9,6 +10,7 @@ from theano.tensor.nnet.blocksparse import ( ...@@ -9,6 +10,7 @@ from theano.tensor.nnet.blocksparse import (
sparse_block_outer_inplace, sparse_block_outer_inplace,
) )
__all__ = [ __all__ = [
SparseBlockGemv, SparseBlockGemv,
SparseBlockOuter, SparseBlockOuter,
......
import sys import sys
print( print(
"DEPRECATION: theano.sandbox.conv no longer provides conv. " "DEPRECATION: theano.sandbox.conv no longer provides conv. "
"They have been moved to theano.tensor.nnet.conv", "They have been moved to theano.tensor.nnet.conv",
......
...@@ -4,14 +4,15 @@ Provides Ops for FFT and DCT. ...@@ -4,14 +4,15 @@ Provides Ops for FFT and DCT.
""" """
# This module will soon be deprecated.
import warnings
import numpy as np import numpy as np
import numpy.fft import numpy.fft
from theano import tensor from theano import tensor
from theano.gof import Op, Apply, generic from theano.gof import Apply, Op, generic
# This module will soon be deprecated.
import warnings
message = ( message = (
"The module theano.sandbox.fourier will soon be deprecated." "The module theano.sandbox.fourier will soon be deprecated."
......
from warnings import warn
from collections.abc import Sequence from collections.abc import Sequence
from warnings import warn
from theano.gof.graph import Constant
from theano.gof.link import ( from theano.gof.link import (
Container,
PerformLinker, PerformLinker,
map_storage,
gc_helper,
utils,
add_clear_storage, add_clear_storage,
Container, gc_helper,
map_storage,
streamline, streamline,
utils,
) )
from theano.gof.graph import Constant
class JAXLinker(PerformLinker): class JAXLinker(PerformLinker):
"""A `Linker` that JIT-compiles NumPy-based operations using JAX. """A `Linker` that JIT-compiles NumPy-based operations using JAX.
......
import theano from collections.abc import Sequence
from functools import reduce
from functools import singledispatch as dispatch
from functools import update_wrapper
from warnings import warn
import jax import jax
import jax.numpy as jnp import jax.numpy as jnp
import jax.scipy as jsp import jax.scipy as jsp
from warnings import warn import theano
from functools import update_wrapper, reduce from theano.compile.ops import (
from collections.abc import Sequence DeepCopyOp,
Rebroadcast,
from functools import singledispatch as dispatch Shape,
Shape_i,
SpecifyShape,
ViewOp,
)
from theano.gof import FunctionGraph from theano.gof import FunctionGraph
from theano.ifelse import IfElse from theano.ifelse import IfElse
from theano.tensor.subtensor import ( from theano.scalar.basic import Cast, Clip, Composite, Identity, ScalarOp
get_idx_list,
Subtensor,
IncSubtensor,
# This is essentially `np.take`
AdvancedSubtensor1,
AdvancedIncSubtensor1,
# Boolean mask indexing and setting
AdvancedSubtensor,
AdvancedIncSubtensor,
)
from theano.scan_module.scan_op import Scan from theano.scan_module.scan_op import Scan
from theano.scan_module.scan_utils import scan_args as ScanArgs from theano.scan_module.scan_utils import scan_args as ScanArgs
from theano.tensor.basic import ( from theano.tensor.basic import (
Dot,
ARange,
TensorFromScalar,
ScalarFromTensor,
AllocEmpty,
Alloc, Alloc,
Reshape, AllocEmpty,
ARange,
Dot,
Join, Join,
MaxAndArgmax, MaxAndArgmax,
Reshape,
ScalarFromTensor,
TensorFromScalar,
) )
from theano.scalar.basic import ScalarOp, Composite, Cast, Clip, Identity from theano.tensor.elemwise import CAReduce, DimShuffle, Elemwise
from theano.tensor.elemwise import Elemwise, CAReduce, DimShuffle from theano.tensor.extra_ops import (
from theano.compile.ops import ( Bartlett,
DeepCopyOp, CumOp,
Shape, DiffOp,
Shape_i, FillDiagonal,
SpecifyShape, FillDiagonalOffset,
Rebroadcast, RavelMultiIndex,
ViewOp, RepeatOp,
Unique,
UnravelIndex,
) )
from theano.tensor.opt import MakeVector
from theano.tensor.nnet.sigm import ScalarSoftplus
from theano.tensor.nlinalg import ( from theano.tensor.nlinalg import (
SVD,
AllocDiag,
Det, Det,
Eig, Eig,
Eigh, Eigh,
ExtractDiag,
MatrixInverse, MatrixInverse,
QRFull, QRFull,
QRIncomplete, QRIncomplete,
SVD,
ExtractDiag,
AllocDiag,
) )
from theano.tensor.nnet.sigm import ScalarSoftplus
from theano.tensor.slinalg import ( from theano.tensor.opt import MakeVector
Cholesky, from theano.tensor.slinalg import Cholesky, Solve
Solve, from theano.tensor.subtensor import ( # This is essentially `np.take`; Boolean mask indexing and setting
AdvancedIncSubtensor,
AdvancedIncSubtensor1,
AdvancedSubtensor,
AdvancedSubtensor1,
IncSubtensor,
Subtensor,
get_idx_list,
) )
from theano.tensor.type_other import MakeSlice from theano.tensor.type_other import MakeSlice
from theano.tensor.extra_ops import (
CumOp,
DiffOp,
RepeatOp,
Bartlett,
FillDiagonal,
FillDiagonalOffset,
Unique,
UnravelIndex,
RavelMultiIndex,
)
if theano.config.floatX == "float64": if theano.config.floatX == "float64":
jax.config.update("jax_enable_x64", True) jax.config.update("jax_enable_x64", True)
......
from theano.tensor.slinalg import cholesky, solve, eigvalsh from theano.sandbox.linalg.ops import psd, spectral_radius_bound
from theano.tensor.nlinalg import ( from theano.tensor.nlinalg import (
matrix_inverse,
diag,
extract_diag,
alloc_diag, alloc_diag,
det, det,
diag,
eig, eig,
eigh, eigh,
extract_diag,
matrix_inverse,
trace, trace,
) )
from theano.sandbox.linalg.ops import psd, spectral_radius_bound from theano.tensor.slinalg import cholesky, eigvalsh, solve
import logging import logging
import theano.tensor
from six import integer_types from six import integer_types
from theano.gof import Op, Apply import theano.tensor
from theano import tensor from theano import tensor
from theano.gof import Apply, Op, local_optimizer
from theano.gof.opt import Optimizer
from theano.tensor import DimShuffle, Dot from theano.tensor import DimShuffle, Dot
from theano.tensor.blas import Dot22 from theano.tensor.blas import Dot22
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.tensor.nlinalg import ( from theano.tensor.nlinalg import (
MatrixInverse, MatrixInverse,
matrix_inverse, det,
extract_diag, extract_diag,
matrix_inverse,
trace, trace,
det,
) )
from theano.tensor.opt import (
from theano.tensor.slinalg import Cholesky, cholesky, Solve, solve, imported_scipy register_canonicalize,
register_specialize,
register_stabilize,
)
from theano.tensor.slinalg import Cholesky, Solve, cholesky, imported_scipy, solve
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
......
import copy import copy
import warnings
import numpy as np import numpy as np
import warnings
import theano import theano
import theano.tensor as tt import theano.tensor as tt
from theano import Apply, Op
from theano import Op, Apply
from theano.scalar import as_scalar from theano.scalar import as_scalar
......
...@@ -3,6 +3,7 @@ Neighbours was moved into theano.tensor.nnet.neighbours. ...@@ -3,6 +3,7 @@ Neighbours was moved into theano.tensor.nnet.neighbours.
This file was created for compatibility. This file was created for compatibility.
""" """
from theano.tensor.nnet.neighbours import images2neibs, neibs2images, Images2Neibs from theano.tensor.nnet.neighbours import Images2Neibs, images2neibs, neibs2images
__all__ = ["images2neibs", "neibs2images", "Images2Neibs"] __all__ = ["images2neibs", "neibs2images", "Images2Neibs"]
...@@ -18,23 +18,22 @@ import warnings ...@@ -18,23 +18,22 @@ import warnings
import numpy as np import numpy as np
from six import integer_types, string_types from six import integer_types, string_types
import theano import theano
from theano import Op, Apply, shared, config, Variable from theano import Apply, Op, Variable, config, function, gradient, shared, tensor
from theano import gradient, function from theano.compile import optdb
from theano.gof import ParamsType, local_optimizer
from theano.gradient import undefined_grad from theano.gradient import undefined_grad
from theano import tensor from theano.scalar import bool as bool_t
from theano.scalar import int32 as int_t
from theano.tensor import ( from theano.tensor import (
TensorType, TensorType,
as_tensor_variable, as_tensor_variable,
get_vector_length,
cast, cast,
get_vector_length,
opt, opt,
scal, scal,
) )
from theano.compile import optdb
from theano.gof import local_optimizer, ParamsType
from theano.scalar import bool as bool_t, int32 as int_t
from . import multinomial from . import multinomial
......
from theano.tensor.nnet.nnet import softsign # noqa from theano.tensor.nnet.nnet import softsign # noqa
import sys import sys
print( print(
"DEPRECATION WARNING: softsign was moved from theano.sandbox.softsign to " "DEPRECATION WARNING: softsign was moved from theano.sandbox.softsign to "
"theano.tensor.nnet.nnet ", "theano.tensor.nnet.nnet ",
......
import warnings import warnings
from theano.tensor.slinalg import solve # noqa from theano.tensor.slinalg import solve # noqa
message = ( message = (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论