diff --git a/python/paddle/fluid/framework.py b/python/paddle/fluid/framework.py index ce69592a07b3094f3f4f974cb7bd39f759cedfd1..136dba59a1265cf13981dffa2919160a4095faaf 100644 --- a/python/paddle/fluid/framework.py +++ b/python/paddle/fluid/framework.py @@ -7449,7 +7449,7 @@ def device_guard(device=None): device, index = device.split(':') if device == 'cpu': raise ValueError("Should not set device id for cpu.") - if device not in ['cpu', 'gpu', 'xpu', '', None]: + if device not in ['cpu', 'gpu', 'xpu', 'npu', '', None]: raise ValueError( "The Attr(device) should be 'cpu' 'npu' or 'gpu', and it can also be empty string or None " "when there is no need to specify device. But received %s" % device