未验证 提交 3191ec5e 编写于 作者: Z zhupengyang 提交者: GitHub

enhance interpolate op when there is no "scale" (#1957)

test=develop
上级 c5e65402
...@@ -79,9 +79,15 @@ bool InterpolateOp::AttachImpl(const cpp::OpDesc& op_desc, lite::Scope* scope) { ...@@ -79,9 +79,15 @@ bool InterpolateOp::AttachImpl(const cpp::OpDesc& op_desc, lite::Scope* scope) {
auto Out = op_desc.Output("Out").front(); auto Out = op_desc.Output("Out").front();
param_.X = scope->FindVar(X)->GetMutable<lite::Tensor>(); param_.X = scope->FindVar(X)->GetMutable<lite::Tensor>();
param_.Out = scope->FindVar(Out)->GetMutable<lite::Tensor>(); param_.Out = scope->FindVar(Out)->GetMutable<lite::Tensor>();
if (op_desc.HasAttr("scale")) {
param_.scale = op_desc.GetAttr<float>("scale"); param_.scale = op_desc.GetAttr<float>("scale");
}
if (op_desc.HasAttr("out_w")) {
param_.out_w = op_desc.GetAttr<int>("out_w"); param_.out_w = op_desc.GetAttr<int>("out_w");
}
if (op_desc.HasAttr("out_h")) {
param_.out_h = op_desc.GetAttr<int>("out_h"); param_.out_h = op_desc.GetAttr<int>("out_h");
}
param_.align_corners = op_desc.GetAttr<bool>("align_corners"); param_.align_corners = op_desc.GetAttr<bool>("align_corners");
param_.interp_method = op_desc.GetAttr<std::string>("interp_method"); param_.interp_method = op_desc.GetAttr<std::string>("interp_method");
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册