Browse Source

!15030 modify adapter tensor size limit

From: @changzherui
Reviewed-by: @kingxian,@zhoufeng54
Signed-off-by: @kingxian
tags/v1.2.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
2d13cd7a5b
1 changed files with 0 additions and 6 deletions
  1. +0
    -6
      mindspore/ccsrc/transform/graph_ir/util.cc

+ 0
- 6
mindspore/ccsrc/transform/graph_ir/util.cc View File

@@ -173,12 +173,6 @@ GeTensorPtr TransformUtil::ConvertTensor(const MeTensorPtr &tensor, const std::s
return nullptr;
}
size_t elements_num = IntToSize(tensor->ElementsNum());
if (UINT_MAX / type_size < elements_num) {
MS_LOG(ERROR) << "The required Me Tensor data buff size " << elements_num << " x " << type_size
<< " overflowed UINT_MAX: " << UINT_MAX << ".";
return nullptr;
}

// get tensor buff size
size_t data_buff_size = elements_num * type_size;
if (data_buff_size == 0) {


Loading…
Cancel
Save