Skip to content

Commit

Permalink
fix bug where the output is a list
Browse files Browse the repository at this point in the history
  • Loading branch information
XJDKC committed Apr 28, 2020
1 parent c3d6c65 commit 61d1ee5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion python/singa/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def wrapper(self, *args, **kwargs):
# deconstruct Operations before running the entire graph
if name == 'optim':
for fname in self._results:
self._results[fname].creator = None
if isinstance(self._results[fname], list):
for _matrix in self._results[fname]:
_matrix.creator = None
else:
self._results[fname].creator = None
# make sure all Operations are deallocated
gc.collect()
# add result tensor
Expand Down
3 changes: 2 additions & 1 deletion src/core/scheduler/scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ void Graph::Debug() {
for (auto it : blkInfos) {
auto blkInfo = it;
ss << "Block[" << std::setw(w) << blkInfo->id_ << "] addr[" << std::setw(w)
<< blkInfo->blk_ << "] graph_ref[" << std::setw(w) << blkInfo->graph_ref_
<< blkInfo->blk_ << "] size[" << std::setw(10) << blkInfo->blk_->size()
<< "] graph_ref[" << std::setw(w) << blkInfo->graph_ref_
<< "] ref_count[" << std::setw(w) << blkInfo->blk_->ref_count() << "] ";
switch (blkInfo->type_) {
case BlockType::kInput:
Expand Down

0 comments on commit 61d1ee5

Please sign in to comment.