提交 faee3e71 authored 作者: Iban Harlouchet's avatar Iban Harlouchet

flake8 for theano/tensor/basic.py

上级 735bac97
...@@ -21,7 +21,6 @@ from theano.tensor.type_other import NoneConst ...@@ -21,7 +21,6 @@ from theano.tensor.type_other import NoneConst
from theano import scalar as scal from theano import scalar as scal
from functools import partial from functools import partial
from six import integer_types from six import integer_types
from theano.gof.utils import hashtype
from theano import compile, printing from theano import compile, printing
from theano.printing import pprint, min_informative_str from theano.printing import pprint, min_informative_str
# For history # For history
...@@ -1003,7 +1002,7 @@ _scal_elemwise = _scal_elemwise_with_nfunc(None, None, None) ...@@ -1003,7 +1002,7 @@ _scal_elemwise = _scal_elemwise_with_nfunc(None, None, None)
class TensorFromScalar(Op): class TensorFromScalar(Op):
__props__ = () __props__ = ()
def make_node(self, s): def make_node(self, s):
assert isinstance(s.type, scal.Scalar) assert isinstance(s.type, scal.Scalar)
return Apply(self, return Apply(self,
...@@ -2316,7 +2315,7 @@ def nonzero_values(a): ...@@ -2316,7 +2315,7 @@ def nonzero_values(a):
class Tri(gof.Op): class Tri(gof.Op):
__props__ = ("dtype",) __props__ = ("dtype",)
def __init__(self, dtype=None): def __init__(self, dtype=None):
if dtype is None: if dtype is None:
dtype = config.floatX dtype = config.floatX
...@@ -2421,7 +2420,7 @@ def triu(m, k=0): ...@@ -2421,7 +2420,7 @@ def triu(m, k=0):
class Eye(gof.Op): class Eye(gof.Op):
__props__ = ("dtype", ) __props__ = ("dtype", )
def __init__(self, dtype=None): def __init__(self, dtype=None):
if dtype is None: if dtype is None:
dtype = config.floatX dtype = config.floatX
...@@ -3943,7 +3942,7 @@ class Reshape(Op): ...@@ -3943,7 +3942,7 @@ class Reshape(Op):
_f16_ok = True _f16_ok = True
check_input = False check_input = False
__props__ = ("ndim",) __props__ = ("ndim",)
# name does not participate because it doesn't affect computations # name does not participate because it doesn't affect computations
def __init__(self, ndim, name=None): def __init__(self, ndim, name=None):
...@@ -4583,7 +4582,7 @@ class _nd_grid(object): ...@@ -4583,7 +4582,7 @@ class _nd_grid(object):
array([[0, 1, 2, 3]], dtype=int8) array([[0, 1, 2, 3]], dtype=int8)
""" """
__props__ = ("sparse",) __props__ = ("sparse",)
def __init__(self, sparse=False): def __init__(self, sparse=False):
self.sparse = sparse self.sparse = sparse
...@@ -4645,7 +4644,7 @@ class PermuteRowElements(Op): ...@@ -4645,7 +4644,7 @@ class PermuteRowElements(Op):
permutation instead. permutation instead.
""" """
__props__ = () __props__ = ()
def make_node(self, x, y, inverse): def make_node(self, x, y, inverse):
x = as_tensor_variable(x) x = as_tensor_variable(x)
y = as_tensor_variable(y) y = as_tensor_variable(y)
...@@ -5317,7 +5316,7 @@ class Diagonal(Op): ...@@ -5317,7 +5316,7 @@ class Diagonal(Op):
:return: A vector representing the diagonal elements. :return: A vector representing the diagonal elements.
""" """
__props__ = ("offset", "axis1", "axis2") __props__ = ("offset", "axis1", "axis2")
def __init__(self, offset=0, axis1=0, axis2=1): def __init__(self, offset=0, axis1=0, axis2=1):
if numpy_diagonal_return_view: if numpy_diagonal_return_view:
self.view_map = {0: [0]} self.view_map = {0: [0]}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论