Browse Source

!890 fix the bug for tensor value summary

From: @yelihua
Reviewed-by: @ouwenchang,@wenkai_dist
Signed-off-by: @wenkai_dist
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
418863a240
2 changed files with 4 additions and 1 deletions
  1. +3
    -1
      mindinsight/debugger/stream_cache/node_type_identifier.py
  2. +1
    -0
      mindinsight/debugger/stream_cache/tensor.py

+ 3
- 1
mindinsight/debugger/stream_cache/node_type_identifier.py View File

@@ -123,7 +123,9 @@ def is_gradient_node(node):
Returns:
bool, if the node is gradient type.
"""
if node.name.startswith('Gradients/') and node.type != NodeTypeEnum.PARAMETER.value:
node_name = node.name.lower()
if node_name.startswith('gradients/') and \
node.type not in [NodeTypeEnum.PARAMETER.value, NodeTypeEnum.CONST.value]:
return True
return False



+ 1
- 0
mindinsight/debugger/stream_cache/tensor.py View File

@@ -174,6 +174,7 @@ class OpTensor(BaseTensor):
res['value'] = tensor_value.tolist()
elif isinstance(tensor_value, str):
res['value'] = tensor_value
res['statistics'] = TensorUtils.get_overall_statistic_dict(self._stats)

return res



Loading…
Cancel
Save