!5103 fix wrong value of int-type Node bug in pynative

Merge pull request !5103 from liangzelang/fix-repeat-key
This commit is contained in:
mindspore-ci-bot 2020-08-25 19:32:23 +08:00 committed by Gitee
commit 3bd0204fca
1 changed files with 3 additions and 1 deletions

View File

@ -772,7 +772,9 @@ std::string PynativeExecutor::GetCellId(const py::object &cell, const py::args &
if (node_abs_map_.find(arg_id) != node_abs_map_.end()) { if (node_abs_map_.find(arg_id) != node_abs_map_.end()) {
cell_id += node_abs_map_[arg_id]->ToString(); cell_id += node_abs_map_[arg_id]->ToString();
} else { } else {
AbstractBasePtr abs = abstract::FromValueInside(PyAttrValue(args[i]), true); auto abs = PyAttrValue(args[i])->ToAbstract();
auto config = abstract::AbstractBase::kBroadenTensorOnly;
abs = abs->Broaden(config);
cell_id += abs->ToString(); cell_id += abs->ToString();
node_abs_map_[arg_id] = abs; node_abs_map_[arg_id] = abs;
} }