From 489481ebe99a2c11b9ad60d7e9bd39174773ef9b Mon Sep 17 00:00:00 2001 From: yelihua Date: Fri, 11 Dec 2020 18:15:40 +0800 Subject: [PATCH] fix the bug of getting const scalar value --- mindinsight/debugger/stream_cache/tensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindinsight/debugger/stream_cache/tensor.py b/mindinsight/debugger/stream_cache/tensor.py index 15af4fa2..f0ee0a80 100644 --- a/mindinsight/debugger/stream_cache/tensor.py +++ b/mindinsight/debugger/stream_cache/tensor.py @@ -293,8 +293,8 @@ class ConstTensor(BaseTensor): if len(fields) != 2: log.warning("Unexpected const proto <%s>.\n Please check offline.", tensor_proto) tensor_value = None - for field_name, field_value in fields: - if field_name != 'dtype': + for field_obj, field_value in fields: + if field_obj.name != 'dtype': tensor_value = field_value break if tensor_value and self.dtype != self._STRING_TYPE: