未验证 提交 a842c1d0 编写于 作者: X xiaoxiaohehe001 提交者: GitHub

[Paddle Inference] Support fill_any_like bool input. (#48671)

* fill_any_like_bool

* fill_any_like_bool
上级 7c577754
......@@ -1226,17 +1226,26 @@ struct SimpleOpTypeSetTeller : public Teller {
return false;
}
int dtype = PADDLE_GET_CONST(int, desc.GetAttr("dtype"));
auto* block = desc.Block();
auto* x_var_desc = block->FindVar(desc.Input("X")[0]);
auto input_type = x_var_desc->GetDataType();
#if IS_TRT_VERSION_GE(8400)
if (dtype == 0 ||
(dtype == -1 && input_type == framework::proto::VarType::BOOL)) {
VLOG(3) << "the fill_any_like supports input of BOOL by trt8.4 above";
return true;
}
#endif
if (dtype != -1 && dtype != 2 && dtype != 5) {
VLOG(3) << "the fill_any_like only supports int32 and float32";
VLOG(3) << "the fill_any_like only supports int32 and float32 by "
"trt8.4 below";
return false;
}
if (dtype == -1) {
auto* block = desc.Block();
auto* x_var_desc = block->FindVar(desc.Input("X")[0]);
auto input_type = x_var_desc->GetDataType();
if (input_type != framework::proto::VarType::INT32 &&
input_type != framework::proto::VarType::FP32) {
VLOG(3) << "the fill_any_like only supports int32 and float32";
VLOG(3) << "the fill_any_like only supports int32 and float32 by "
"trt8.4 below";
return false;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册