未验证 提交 d3c93942 编写于 作者: J JingZhuangzhuang 提交者: GitHub

Fix conv2d op_teller error (#36474)

上级 79dbbcce
......@@ -242,9 +242,31 @@ bool OpTeller::Tell(const framework::ir::Node* node, bool use_no_calib_int8,
if (desc.HasAttr("padding_algorithm")) {
auto padding_algorithm =
BOOST_GET_CONST(std::string, desc.GetAttr("padding_algorithm"));
if (padding_algorithm == "SAME" || padding_algorithm == "VALID") {
if (padding_algorithm == "VALID") {
return false;
}
if (padding_algorithm == "SAME") {
if (desc.HasAttr("dilations")) {
const std::vector<int> dilations =
BOOST_GET_CONST(std::vector<int>, desc.GetAttr("dilations"));
if (dilations[0] != 1 || dilations[1] != 1) {
VLOG(3) << "In Same mode, Dilations must be (1, 1) for "
"tensorRT, but given ("
<< dilations[0] << ", " << dilations[1] << ")";
return false;
}
}
}
}
if (use_no_calib_int8) {
if (desc.HasAttr("padding_algorithm")) {
auto padding_algorithm =
BOOST_GET_CONST(std::string, desc.GetAttr("padding_algorithm"));
if (padding_algorithm == "SAME") {
return false;
}
}
}
if (desc.HasAttr("enable_int8")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册