提交 8c69d0c8 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

better implementation of __str__

Basically add information about scan if it stops on a condition or not (using keyword for or while)
上级 f7f37abb
...@@ -315,15 +315,17 @@ class Scan(Op): ...@@ -315,15 +315,17 @@ class Scan(Op):
gpu_str = 'gpu' gpu_str = 'gpu'
else: else:
gpu_str = 'cpu' gpu_str = 'cpu'
if self.inplace : if self.as_while:
aux_txt = '{inplace,%s}'%gpu_str name = 'while'
else: else:
aux_txt = '{%s}'%gpu_str name = 'for'
if self.name: if self.inplace :
return self.name+aux_txt aux_txt = '%s{inplace,%s,%s}'%(name, gpu_str, str(self.name))
else: else:
return 'scan'+aux_txt aux_txt = '%s{%s,%s}'%(name,gpu_str, str(self.name))
return aux_txt
def __hash__(self): def __hash__(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论