未验证 提交 1431305e 编写于 作者: Z zyfncg 提交者: GitHub

fix kernel backend select bug (#41002)

上级 d101334c
......@@ -25,16 +25,19 @@ namespace experimental {
namespace detail {
BackendSet GetTensorBackendSet(const phi::TensorBase& t) {
BackendSet backend_set(phi::TransToPhiBackend(t.place()));
switch (t.layout()) {
case DataLayout::MKLDNN:
backend_set = backend_set | BackendSet(Backend::MKLDNN);
break;
default:
// do nothing
break;
if (t.initialized()) {
BackendSet backend_set(phi::TransToPhiBackend(t.place()));
switch (t.layout()) {
case DataLayout::MKLDNN:
backend_set = backend_set | BackendSet(Backend::MKLDNN);
break;
default:
// do nothing
break;
}
return backend_set;
}
return backend_set;
return BackendSet(Backend::UNDEFINED);
}
std::size_t CountLeadingZeros(uint64_t val) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册