未验证 提交 23def396 编写于 作者: Y YuanRisheng 提交者: GitHub

fix mkldnn bugs (#45770)

上级 192b3033
......@@ -1328,8 +1328,10 @@ bool OperatorWithKernel::SupportsMKLDNN(
auto has_phi_kernel =
std::any_of(phi_kernels.begin(),
phi_kernels.end(),
[](phi::KernelKeyMap::const_reference kern_pair) {
return kern_pair.first.backend() == phi::Backend::ONEDNN;
[data_type](phi::KernelKeyMap::const_reference kern_pair) {
return kern_pair.first.backend() == phi::Backend::ONEDNN &&
kern_pair.first.dtype() ==
framework::TransToPhiDataType(data_type);
});
if (has_phi_kernel) {
return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册