!14192 add the force transform to avoid the utf8 error

From: @yepei6
Reviewed-by: @kingxian,@kisnwang
Signed-off-by: @kingxian
This commit is contained in:
mindspore-ci-bot 2021-03-27 09:33:40 +08:00 committed by Gitee
commit e9ada9fd1d
1 changed files with 1 additions and 1 deletions

View File

@ -227,6 +227,7 @@ bool SaveDataset2File(acltdtDataset *acl_dataset, const std::string &print_file_
size_t acl_data_size = acltdtGetDataSizeFromItem(item);
aclDataType acl_data_type = acltdtGetDataTypeFromItem(item);
char *acl_data = reinterpret_cast<char *>(acl_addr);
acl_data = const_cast<char *>(reinterpret_cast<std::string *>(acl_data)->c_str());
MS_EXCEPTION_IF_NULL(acl_data);
ShapeVector tensorShape;
@ -256,7 +257,6 @@ bool SaveDataset2File(acltdtDataset *acl_dataset, const std::string &print_file_
}
tensor->set_tensor_type(parse_type);
acl_data = const_cast<char *>(reinterpret_cast<std::string *>(acl_data)->c_str());
std::string data(reinterpret_cast<const char *>(acl_data), acl_data_size);
tensor->set_tensor_content(data);
}