提交 512cb95c authored 作者: Nicolas Bouchard's avatar Nicolas Bouchard 提交者: Frederic

Pep8

上级 e8ee0256
...@@ -506,6 +506,7 @@ uint_dtypes = [t for t in all_dtypes if t[:4] == 'uint'] ...@@ -506,6 +506,7 @@ uint_dtypes = [t for t in all_dtypes if t[:4] == 'uint']
continuous_dtypes = complex_dtypes + float_dtypes continuous_dtypes = complex_dtypes + float_dtypes
discrete_dtypes = int_dtypes + uint_dtypes discrete_dtypes = int_dtypes + uint_dtypes
# CONSTRUCTION # CONSTRUCTION
class CSMProperties(gof.Op): class CSMProperties(gof.Op):
"""Extract all of .data .indices and .indptr """Extract all of .data .indices and .indptr
...@@ -792,7 +793,8 @@ class CSMGradC(gof.Op): ...@@ -792,7 +793,8 @@ class CSMGradC(gof.Op):
def __str__(self): def __str__(self):
return self.__class__.__name__ return self.__class__.__name__
def make_node(self, a_val, a_ind, a_ptr, a_dim, b_val, b_ind, b_ptr, b_dim): def make_node(self, a_val, a_ind, a_ptr, a_dim,
b_val, b_ind, b_ptr, b_dim):
return gof.Apply(self, [a_val, a_ind, a_ptr, a_dim, return gof.Apply(self, [a_val, a_ind, a_ptr, a_dim,
b_val, b_ind, b_ptr, b_dim], [b_val.type()]) b_val, b_ind, b_ptr, b_dim], [b_val.type()])
...@@ -905,6 +907,15 @@ class CSMGradC(gof.Op): ...@@ -905,6 +907,15 @@ class CSMGradC(gof.Op):
return (3,) return (3,)
csm_grad_c = CSMGradC() csm_grad_c = CSMGradC()
@gof.local_optimizer([csm_grad(None)])
def local_csm_grad_c(node):
""" csm_grad(None) -> csm_grad_c """
if node.op == csm_grad(None):
return [csm_grad_c(*node.inputs)]
return False
register_specialize(local_csm_grad_c)
# #
# Conversion # Conversion
# #
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论