diff --git a/python/paddle/fluid/dygraph/layers.py b/python/paddle/fluid/dygraph/layers.py index fd824de3a1e6a45df7e0ad5dfa596d1817e68dd6..edaed181663368826ec59424ac0c9dc36b933953 100644 --- a/python/paddle/fluid/dygraph/layers.py +++ b/python/paddle/fluid/dygraph/layers.py @@ -1262,6 +1262,10 @@ class Layer(core.Layer): place = core.CPUPlace() elif p.is_cuda_pinned_place(): place = core.CUDAPinnedPlace() + elif p.is_xpu_place(): + p = core.Place() + p.set_place(t._place()) + place = core.XPUPlace(p.xpu_device_id()) else: p = core.Place() p.set_place(t._place())