!11750 fix resize_base bug & fix fp16subgraph bug when const-input gather exist

From: @hangangqiang
Reviewed-by: @zhanghaibo5,@ddwsky
Signed-off-by: @zhanghaibo5
This commit is contained in:
mindspore-ci-bot 2021-01-28 17:00:01 +08:00 committed by Gitee
commit a84a5215ca
3 changed files with 7 additions and 5 deletions

View File

@ -62,7 +62,7 @@ int ResizeBaseCPUKernel::CheckParameters() {
MS_LOG(INFO) << "Out shape is not assigned";
const_shape_ = false;
} else {
auto ret = CalculateNewHeightWidth();
auto ret = CalculateLinearNewHeightWidth();
if (ret != RET_OK) {
return ret;
}
@ -78,7 +78,10 @@ int ResizeBaseCPUKernel::CheckParameters() {
return RET_OK;
}
int ResizeBaseCPUKernel::CalculateNewHeightWidth() {
int ResizeBaseCPUKernel::CalculateLinearNewHeightWidth() {
if (method_ != static_cast<int>(schema::ResizeMethod_LINEAR)) {
return RET_OK;
}
if (in_tensors_.size() != 2) {
return RET_ERROR;
}

View File

@ -47,7 +47,7 @@ class ResizeBaseCPUKernel : public LiteKernel {
private:
int CheckParameters();
int CheckInputsOuputs();
int CalculateNewHeightWidth();
int CalculateLinearNewHeightWidth();
};
} // namespace mindspore::kernel

View File

@ -282,8 +282,7 @@ int Tensor::set_root_tensor(Tensor *tensor) {
return RET_OK;
}
if (this->root_tensor_ == nullptr) {
MS_LOG(ERROR) << "root tensor is nullptr";
return RET_NULL_PTR;
return RET_OK;
}
this->shape_ = this->root_tensor_->shape_;
this->format_ = this->root_tensor_->format_;