From b3cd639c09129168fc74e3e52d0d8f2728efabeb Mon Sep 17 00:00:00 2001 From: y00445136 Date: Thu, 2 Apr 2020 11:39:24 +0800 Subject: [PATCH] add support for bool --- mindspore/ccsrc/utils/tensorprint_utils.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/utils/tensorprint_utils.cc b/mindspore/ccsrc/utils/tensorprint_utils.cc index ee58ed418cd..1036b424ba6 100644 --- a/mindspore/ccsrc/utils/tensorprint_utils.cc +++ b/mindspore/ccsrc/utils/tensorprint_utils.cc @@ -37,13 +37,13 @@ static std::map print_type_map = { {"int32_t", TypeId::kNumberTypeInt32}, {"uint32_t", TypeId::kNumberTypeUInt32}, {"int64_t", TypeId::kNumberTypeInt64}, {"uint64_t", TypeId::kNumberTypeUInt64}, {"float16", TypeId::kNumberTypeFloat16}, {"float", TypeId::kNumberTypeFloat32}, - {"double", TypeId::kNumberTypeFloat64}}; + {"double", TypeId::kNumberTypeFloat64}, {"bool", TypeId::kNumberTypeBool}}; static std::map type_size_map = { {"int8_t", sizeof(int8_t)}, {"uint8_t", sizeof(uint8_t)}, {"int16_t", sizeof(int16_t)}, {"uint16_t", sizeof(uint16_t)}, {"int32_t", sizeof(int32_t)}, {"uint32_t", sizeof(uint32_t)}, {"int64_t", sizeof(int64_t)}, {"uint64_t", sizeof(uint64_t)}, {"float16", sizeof(float) / 2}, - {"float", sizeof(float)}, {"double", sizeof(double)}}; + {"float", sizeof(float)}, {"double", sizeof(double)}, {"bool", sizeof(bool)}}; bool ParseTensorShape(const std::string &input_shape_str, std::vector *const tensor_shape, size_t *dims) { if (tensor_shape == nullptr) { @@ -107,7 +107,7 @@ bool ConvertDataItem2Tensor(const std::vector &items) { } else { auto type_iter = print_type_map.find(item.tensorType_); if (type_iter == print_type_map.end()) { - MS_LOG(ERROR) << "type of tensor need to print is not soupport" << item.tensorType_; + MS_LOG(ERROR) << "type of tensor need to print is not support " << item.tensorType_; continue; } auto type_id = type_iter->second;