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

fix kernel backend select bug (#41002)

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