!20018 [MSLITE][Develop] fix bug of tensor_rt

Merge pull request !20018 from yangruoqi713/r1.3
This commit is contained in:
i-robot 2021-07-12 07:17:27 +00:00 committed by Gitee
commit ec052373d1
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ int GatherTensorRT::IsSupport(const schema::Primitive *primitive, const std::vec
return RET_ERROR;
}
if (in_tensors[2].ElementNum() == 1) {
axis_ = static_cast<int *>(in_tensors[2].MutableData())[0];
axis_ = static_cast<const int *>(in_tensors[2].Data().get())[0];
} else {
MS_LOG(ERROR) << "TensorRT axis is attribute.";
return RET_ERROR;