未验证 提交 5d7e5e35 编写于 作者: W Wilber 提交者: GitHub

[Release/1.8] Fix run ssd model with trt error. (#28705)

* update.

* fix trt error in ssd model.
上级 ec672e88
...@@ -107,7 +107,14 @@ bool OpTeller::Tell(const std::string& op_type, const framework::OpDesc& desc, ...@@ -107,7 +107,14 @@ bool OpTeller::Tell(const std::string& op_type, const framework::OpDesc& desc,
op_type == "depthwise_conv2d" || op_type == "conv2d_transpose") { op_type == "depthwise_conv2d" || op_type == "conv2d_transpose") {
std::vector<int> paddings = std::vector<int> paddings =
boost::get<std::vector<int>>(desc.GetAttr("paddings")); boost::get<std::vector<int>>(desc.GetAttr("paddings"));
if (paddings.size() > 2) return false;
std::string padding_algorithm = "EXPLICIT";
if (desc.HasAttr("padding_algorithm"))
padding_algorithm =
boost::get<std::string>(desc.GetAttr("padding_algorithm"));
if (paddings.size() > 2 ||
(padding_algorithm == "SAME" && op_type != "pool2d"))
return false;
} }
if (op_type == "matmul") { if (op_type == "matmul") {
auto* block = desc.Block(); auto* block = desc.Block();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册