diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index 8702c800498ef5a82eac9a4939ac4a04ea15d30c..7f282b8cea07a8ced6adb003cfb04b9b06d26569 100644 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -1416,7 +1416,10 @@ class Executor(object): [lr_value]).astype(convert_dtype(lr_var.dtype)) tensor = core.get_variable_tensor(scope, lr_sheduler._var_name) - tensor.set(data, self.place) + # NOTE(dev): `set` always call TensorCopySync that is a + # blocking behavior. So we use `_copy_from` to replace it. + cpu_tensor = _as_lodtensor(data, core.CPUPlace()) + tensor._copy_from(cpu_tensor, self.place) return new_exe.run(list(feed.keys()), fetch_list, return_numpy)