提交 dcd7cb56 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

Avoid printing all the values of a constant if it takes more then 20

characters.
上级 ee0d9cfc
...@@ -1299,7 +1299,11 @@ class TensorConstant(_tensor_py_operators, Constant): ...@@ -1299,7 +1299,11 @@ class TensorConstant(_tensor_py_operators, Constant):
To create a TensorConstant, use the `constant` function in this module. To create a TensorConstant, use the `constant` function in this module.
""" """
def __str__(self): def __str__(self):
return "TensorConstant{%s}" % self.data name = "%s"%self.data
if len(name) > 20:
name = name[:10]+".."+name[-10:]
return "TensorConstant{%s}" % name
def signature(self): def signature(self):
return TensorConstantSignature((self.type, self.data)) return TensorConstantSignature((self.type, self.data))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论