leezu commented on a change in pull request #20262:
URL: https://github.com/apache/incubator-mxnet/pull/20262#discussion_r649214029



##########
File path: python/mxnet/gluon/block.py
##########
@@ -1088,6 +1088,7 @@ def _get_graph(self, *args):
                 out = super().__call__(*args)
             flatten_out, self._out_format = _flatten(out, "output")
             symbol_outputs = dc.get_symbol(flatten_out, 
sym_cls=type(symbol_inputs[0]))
+            dc.clear(flatten_out)

Review comment:
       Thanks, this is better than using the destructor. But I think there's 
still a leak of the graph and once that leak is fixed, the clear call can be 
removed? If so, would you mind adding a comment that this is temporary (though 
it's fine to keep for this PR).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to