未验证 提交 0883cf37 编写于 作者: A Aurelius84 提交者: GitHub

[newExe]Fix blocking in lr_sheduler from Executor (#38786)

上级 f634c0b1
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册