未验证 提交 587b67ef 编写于 作者: W wawltor 提交者: GitHub

fix the state_dict bug for the xpu (#29888)

fix the state_dict bug for the xpu
上级 121658d2
...@@ -1274,6 +1274,10 @@ class Layer(core.Layer): ...@@ -1274,6 +1274,10 @@ class Layer(core.Layer):
place = core.CPUPlace() place = core.CPUPlace()
elif p.is_cuda_pinned_place(): elif p.is_cuda_pinned_place():
place = core.CUDAPinnedPlace() place = core.CUDAPinnedPlace()
elif p.is_xpu_place():
p = core.Place()
p.set_place(t._place())
place = core.XPUPlace(p.xpu_device_id())
else: else:
p = core.Place() p = core.Place()
p.set_place(t._place()) p.set_place(t._place())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册