未验证 提交 d5df6bdf 编写于 作者: W wanghuancoder 提交者: GitHub

fix 2 bug: 1.skip lodtensorarray; 2.delete feed op (#37090)

* fix 2 bug: 1.skip lodtensorarray; 2.delete feed op, test=develop

* program clone, test=develop
上级 8395f573
......@@ -379,6 +379,9 @@ std::vector<OpFuncNode> apply_data_transform(
for (auto& var_name_item : *ins_map_temp) {
for (size_t i = 0; i < var_name_item.second.size(); ++i) {
auto var = var_name_item.second[i];
if (!(var->IsType<LoDTensor>() || var->IsType<SelectedRows>())) {
continue;
}
auto& var_name = inputs_names[var_name_item.first].at(i);
auto tensor_in = GetLoDTensorOrSelectedRowsValueFromVar(*var);
if (!tensor_in->IsInitialized()) {
......
......@@ -34,6 +34,7 @@ from .trainer_factory import FetchHandlerMonitor
import copy
from . import framework
from .incubate.checkpoint import auto_checkpoint as acp
from .compiler import _prune_feed_ops
__all__ = ['Executor', 'global_scope', 'scope_guard']
......@@ -598,7 +599,9 @@ class _ExecutorCache(object):
program, Program), "Required type(Program), but received {}".format(
type(program).__name__)
if program not in self._cached_executors:
new_exe = _StandaloneExecutor(self._place, program, scope)
new_program = program.clone()
_prune_feed_ops(new_program)
new_exe = _StandaloneExecutor(self._place, new_program, scope)
self._cached_executors[program] = new_exe
return self._cached_executors[program]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册