提交 56539bcd authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Update FunctionGraph.replace exception messages

上级 51792fea
...@@ -452,20 +452,16 @@ class FunctionGraph(MetaObject): ...@@ -452,20 +452,16 @@ class FunctionGraph(MetaObject):
r = self.outputs[i] r = self.outputs[i]
if not r.type == new_var.type: if not r.type == new_var.type:
raise TypeError( raise TypeError(
"The type of the replacement must be the" f"The type of the replacement ({new_var.type}) must be the"
" same as the type of the original Variable.", f" same as the type of the original Variable ({r.type})."
r,
new_var,
) )
self.outputs[i] = new_var self.outputs[i] = new_var
else: else:
r = node.inputs[i] r = node.inputs[i]
if not r.type == new_var.type: if not r.type == new_var.type:
raise TypeError( raise TypeError(
"The type of the replacement must be the" f"The type of the replacement ({new_var.type}) must be the"
" same as the type of the original Variable.", f" same as the type of the original Variable ({r.type})."
r,
new_var,
) )
node.inputs[i] = new_var node.inputs[i] = new_var
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论