mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 03:34:26 +08:00
STY: Flake8 and parameter rename.
This commit is contained in:
@@ -382,7 +382,8 @@ class SimplePipelineEngine(object):
|
||||
else:
|
||||
assert workspace[term].shape == (mask.shape[0], 1)
|
||||
|
||||
# Decref dependencies of ``term``, and clear any terms whose refcounts hit 0.
|
||||
# Decref dependencies of ``term``, and clear any terms whose
|
||||
# refcounts hit 0.
|
||||
for garbage_term in graph.decref_dependencies(term, refcounts):
|
||||
del workspace[garbage_term]
|
||||
|
||||
|
||||
@@ -119,10 +119,15 @@ class TermGraph(DiGraph):
|
||||
def _repr_png_(self):
|
||||
return self.png.data
|
||||
|
||||
def initial_refcounts(self, initial_workspace):
|
||||
def initial_refcounts(self, initial_terms):
|
||||
"""
|
||||
Calculate initial refcounts for execution of this graph.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
initial_terms : iterable[Term]
|
||||
An iterable of terms that were pre-computed before graph execution.
|
||||
|
||||
Each node starts with a refcount equal to its outdegree, and output
|
||||
nodes get one extra reference to ensure that they're still in the graph
|
||||
at the end of execution.
|
||||
@@ -131,7 +136,7 @@ class TermGraph(DiGraph):
|
||||
for t in self.outputs.values():
|
||||
refcounts[t] += 1
|
||||
|
||||
for t in initial_workspace:
|
||||
for t in initial_terms:
|
||||
self.decref_dependencies(t, refcounts)
|
||||
|
||||
return refcounts
|
||||
|
||||
Reference in New Issue
Block a user