提交 58b0847e authored 作者: Iban Harlouchet's avatar Iban Harlouchet

Whitespaces removed to theano/sparse/basic.py

上级 29abb700
...@@ -823,7 +823,7 @@ csm_grad = CSMGrad ...@@ -823,7 +823,7 @@ csm_grad = CSMGrad
class Cast(gof.op.Op): class Cast(gof.op.Op):
# See doc in instance of this Op or function after this class definition. # See doc in instance of this Op or function after this class definition.
__props__ = ("out_type",) __props__ = ("out_type",)
def __init__(self, out_type): def __init__(self, out_type):
self.out_type = out_type self.out_type = out_type
...@@ -897,7 +897,7 @@ def cast(variable, dtype): ...@@ -897,7 +897,7 @@ def cast(variable, dtype):
class DenseFromSparse(gof.op.Op): class DenseFromSparse(gof.op.Op):
# See doc in instance of this Op or function after this class definition. # See doc in instance of this Op or function after this class definition.
__props__ = () # We don't put sparse_grad in the props. __props__ = () # We don't put sparse_grad in the props.
def __init__(self, structured=True): def __init__(self, structured=True):
self.sparse_grad = structured self.sparse_grad = structured
...@@ -1584,7 +1584,7 @@ def row_scale(x, s): ...@@ -1584,7 +1584,7 @@ def row_scale(x, s):
class SpSum(gof.op.Op): class SpSum(gof.op.Op):
# See doc in instance of this Op or function after this class definition. # See doc in instance of this Op or function after this class definition.
__props__ = ("axis",) __props__ = ("axis",)
# WARNING: judgement call... # WARNING: judgement call...
# We are not using the structured in the comparison or hashing # We are not using the structured in the comparison or hashing
...@@ -2352,7 +2352,7 @@ class __ComparisonOpSD(gof.op.Op): ...@@ -2352,7 +2352,7 @@ class __ComparisonOpSD(gof.op.Op):
:return: Comparison(x,y) :return: Comparison(x,y)
""" """
__props__ = () __props__ = ()
# Function to override # Function to override
def comparison(self, x, y): def comparison(self, x, y):
raise NotImplementedError() raise NotImplementedError()
...@@ -2377,6 +2377,7 @@ class __ComparisonOpSD(gof.op.Op): ...@@ -2377,6 +2377,7 @@ class __ComparisonOpSD(gof.op.Op):
def infer_shape(self, node, ins_shapes): def infer_shape(self, node, ins_shapes):
return [ins_shapes[0]] return [ins_shapes[0]]
def __ComparisonSwitch(SS, SD, DS): def __ComparisonSwitch(SS, SD, DS):
""" """
:param SS: function to apply between two sparses matrices. :param SS: function to apply between two sparses matrices.
...@@ -2573,7 +2574,7 @@ ge = __ComparisonSwitch(greater_equal_s_s, greater_equal_s_d, ...@@ -2573,7 +2574,7 @@ ge = __ComparisonSwitch(greater_equal_s_s, greater_equal_s_d,
class HStack(gof.op.Op): class HStack(gof.op.Op):
# See doc in instance of this Op or function after this class definition. # See doc in instance of this Op or function after this class definition.
__props__ = ("format", "dtype") __props__ = ("format", "dtype")
def __init__(self, format=None, dtype=None): def __init__(self, format=None, dtype=None):
if format is None: if format is None:
self.format = 'csc' self.format = 'csc'
...@@ -2733,7 +2734,7 @@ def vstack(blocks, format=None, dtype=None): ...@@ -2733,7 +2734,7 @@ def vstack(blocks, format=None, dtype=None):
class Remove0(gof.Op): class Remove0(gof.Op):
# See doc in instance of this Op or a function after the class definition. # See doc in instance of this Op or a function after the class definition.
__props__ = ("inplace",) __props__ = ("inplace",)
def __init__(self, inplace=False): def __init__(self, inplace=False):
self.inplace = inplace self.inplace = inplace
if self.inplace: if self.inplace:
...@@ -3005,7 +3006,7 @@ class TrueDot(gof.op.Op): ...@@ -3005,7 +3006,7 @@ class TrueDot(gof.op.Op):
# TODO # TODO
# Simplify code by splitting into DotSS and DotSD. # Simplify code by splitting into DotSS and DotSD.
__props__ = () __props__ = ()
# The grad_preserves_dense attribute doesn't change the # The grad_preserves_dense attribute doesn't change the
# execution behavior. To let the optimizer merge nodes with # execution behavior. To let the optimizer merge nodes with
...@@ -3089,6 +3090,7 @@ class TrueDot(gof.op.Op): ...@@ -3089,6 +3090,7 @@ class TrueDot(gof.op.Op):
def infer_shape(self, node, shapes): def infer_shape(self, node, shapes):
return [(shapes[0][0], shapes[1][1])] return [(shapes[0][0], shapes[1][1])]
def true_dot(x, y, grad_preserves_dense=True): def true_dot(x, y, grad_preserves_dense=True):
""" """
Operation for efficiently calculating the dot product when Operation for efficiently calculating the dot product when
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论