提交 5713a048 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Makind __str__ much more nicer by specifying if scan runs on CPU/GPU or if

it is inplace.
上级 38166257
...@@ -336,10 +336,19 @@ class Scan(Op): ...@@ -336,10 +336,19 @@ class Scan(Op):
return self.info == other.info return self.info == other.info
def __str__(self): def __str__(self):
if self.gpu:
gpu_str = 'gpu'
else:
gpu_str = 'cpu'
if self.inplace :
aux_txt = '[inplace,%s]'%gpu_str
else:
aux_txt = '[%s]'%gpu_str
if self.name: if self.name:
return self.name return self.name+aux_txt
else: else:
return 'scan' return 'scan'+aux_txt
def __hash__(self): def __hash__(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论