Browse Source

debugger: bugfix, hide the large const tensor value in GraphProto

tags/v1.0.0
zhangyunshu 5 years ago
parent
commit
4a5f737899
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      mindinsight/datavisual/data_transform/graph/msgraph.py

+ 4
- 1
mindinsight/datavisual/data_transform/graph/msgraph.py View File

@@ -119,7 +119,10 @@ class MSGraph(Graph):
continue
node = Node(name=const.key, node_id=const.key)
node.type = NodeTypeEnum.CONST.value
node.add_attr({const.key: str(const.value)})
if const.value.ByteSize() > self.MAX_NODE_ATTRIBUTE_VALUE_BYTES:
node.add_attr({const.key: 'dtype: ' + DataType.Name(const.value.dtype)})
else:
node.add_attr({const.key: str(const.value)})

if const.value.dtype == DataType.DT_TENSOR:
shape = list(const.value.tensor_val.dims)


Loading…
Cancel
Save