提交 96ce7bd7 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Apply isort to theano.sparse sub-package modules

上级 c0b324fa
import sys
try:
import scipy
......@@ -19,8 +20,8 @@ except ImportError:
from theano.sparse.type import *
if enable_sparse:
from theano.sparse import opt, sharedvar
from theano.sparse.basic import *
from theano.sparse import opt
from theano.sparse import sharedvar
from theano.sparse.sharedvar import sparse_constructor as shared
......@@ -13,17 +13,16 @@ http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps
import sys
import numpy as np
import scipy.sparse
from numpy.lib.stride_tricks import as_strided
from six import integer_types
import scipy.sparse
import theano
from theano import gof, tensor, scalar, config
from theano.gradient import DisconnectedType
from theano.sparse.utils import hash_from_sparse
from theano.gradient import grad_not_implemented, grad_undefined
from theano import config, gof, scalar, tensor
from theano.gradient import DisconnectedType, grad_not_implemented, grad_undefined
from theano.sparse.type import SparseType, _is_sparse
from theano.sparse.utils import hash_from_sparse
sparse_formats = ["csc", "csr"]
......
......@@ -3,20 +3,20 @@ import scipy
import theano
from theano import gof, scalar, tensor
from theano.tensor import blas
from theano.tensor.opt import register_specialize, register_canonicalize
from theano.sparse import (
from theano.sparse import basic as sparse
from theano.sparse.basic import (
CSC,
CSR,
csm_properties,
csm_data,
csm_grad,
usmm,
csm_indices,
csm_indptr,
csm_data,
csm_properties,
usmm,
)
from theano.sparse import basic as sparse
from theano.tensor import blas
from theano.tensor.opt import register_canonicalize, register_specialize
_is_sparse_variable = sparse._is_sparse_variable
_is_dense = sparse._is_dense
......
......@@ -11,10 +11,9 @@ U{http://www-users.cs.umn.edu/~saad/software/SPARSKIT/paper.ps}.
import numpy as np
from scipy import sparse as scipy_sparse
import theano
import theano.sparse
from theano import sparse, Op, tensor
from theano import Op, sparse, tensor
def register_specialize(lopt, *tags, **kwargs):
......
import numpy as np
import theano
import scipy.sparse
import theano
from theano import gof, tensor
from theano.tensor import discrete_dtypes, float_dtypes
from theano.tensor.opt import register_specialize
from theano.sparse.basic import (
as_sparse_variable,
SparseType,
add_s_s,
neg,
mul_s_s,
mul_s_d,
dot,
CSMProperties,
CSM,
_is_sparse_variable,
_is_dense_variable,
from theano.sparse.basic import ( # To maintain compatibility
CSC,
CSM,
CSR,
csm_properties,
AddSSData,
Cast,
CSMProperties,
HStack,
MulSV,
Remove0,
SamplingDot,
SparseType,
StructuredAddSV,
VStack,
_is_dense_variable,
_is_sparse,
_is_sparse_variable,
add_s_s,
add_s_s_data,
as_sparse_variable,
bcast,
ccast,
csm_data,
csm_indices,
csm_indptr,
csm_properties,
csm_shape,
_is_sparse,
# To maintain compatibility
Remove0,
remove0,
Cast,
bcast,
wcast,
icast,
lcast,
fcast,
dcast,
ccast,
zcast,
HStack,
dot,
fcast,
hstack,
VStack,
vstack,
AddSSData,
add_s_s_data,
MulSV,
icast,
lcast,
mul_s_d,
mul_s_s,
mul_s_v,
structured_monoid,
structured_sigmoid,
neg,
remove0,
sampling_dot,
structured_add,
structured_add_s_v,
structured_exp,
structured_log,
structured_pow,
structured_minimum,
structured_maximum,
structured_add,
StructuredAddSV,
structured_add_s_v,
SamplingDot,
sampling_dot,
structured_minimum,
structured_monoid,
structured_pow,
structured_sigmoid,
vstack,
wcast,
zcast,
)
# Probability Ops are currently back in sandbox, because they do not respect
# Theano's Op contract, as their behaviour is not reproducible: calling
# the perform() method twice with the same argument will yield different
# results.
# from theano.sparse.basic import (
# Multinomial, multinomial, Poisson, poisson,
# Binomial, csr_fbinomial, csc_fbinomial, csr_dbinomial, csc_dbinomial)
# Also for compatibility
from theano.sparse.opt import (
MulSDCSC,
mul_s_d_csc,
MulSDCSR,
mul_s_d_csr,
MulSVCSR,
mul_s_v_csr,
StructuredAddSVCSR,
structured_add_s_v_csr,
SamplingDotCSR,
sampling_dot_csr,
StructuredAddSVCSR,
local_mul_s_d,
local_mul_s_v,
local_structured_add_s_v,
local_sampling_dot_csr,
local_structured_add_s_v,
mul_s_d_csc,
mul_s_d_csr,
mul_s_v_csr,
sampling_dot_csr,
structured_add_s_v_csr,
)
from theano.tensor import discrete_dtypes, float_dtypes
from theano.tensor.opt import register_specialize
# Probability Ops are currently back in sandbox, because they do not respect
# Theano's Op contract, as their behaviour is not reproducible: calling
# the perform() method twice with the same argument will yield different
# results.
# from theano.sparse.basic import (
# Multinomial, multinomial, Poisson, poisson,
# Binomial, csr_fbinomial, csc_fbinomial, csr_dbinomial, csc_dbinomial)
# Alias to maintain compatibility
......
import copy
import scipy.sparse
from theano.compile import shared_constructor, SharedVariable
from theano.compile import SharedVariable, shared_constructor
from theano.sparse.basic import SparseType, _sparse_py_operators
......
import numpy as np
try:
import scipy.sparse
......@@ -7,9 +8,10 @@ try:
except ImportError:
imported_scipy = False
from six import string_types
import theano
from theano import gof
from six import string_types
def _is_sparse(x):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论