提交 e271e455 authored 作者: David Warde-Farley's avatar David Warde-Farley

Improved __str__ for IfElse.

上级 417046f7
...@@ -93,13 +93,14 @@ class IfElse(PureOp): ...@@ -93,13 +93,14 @@ class IfElse(PureOp):
return rval return rval
def __str__(self): def __str__(self):
name = 'if{%s' % str(self.name) args = []
if self.name is not None:
args.append(self.name)
if self.as_view: if self.as_view:
name += ',inplace' args.append('inplace')
if self.gpu: if self.gpu:
name += ',gpu' args.append('gpu')
name += '}' return 'if{%s}' % ','.join(args)
return name
def infer_shape(self, node, inputs_shapes): def infer_shape(self, node, inputs_shapes):
# By construction, corresponding then/else pairs have the same number # By construction, corresponding then/else pairs have the same number
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论