forked from mindspore-Ecosystem/mindspore
!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:
commit
a84a5215ca
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ class ResizeBaseCPUKernel : public LiteKernel {
|
|||
private:
|
||||
int CheckParameters();
|
||||
int CheckInputsOuputs();
|
||||
int CalculateNewHeightWidth();
|
||||
int CalculateLinearNewHeightWidth();
|
||||
};
|
||||
} // namespace mindspore::kernel
|
||||
|
||||
|
|
|
@ -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_;
|
||||
|
|
Loading…
Reference in New Issue