// there are less than N remaining. N=100.
result = self.create_accumulator()
// Make sure summaries is an iterator (so it remembers its position).
summaries = iter(summaries)
graph_state = self._get_graph_state()
while True:
batched_summaries = list(itertools.islice(summaries, 100))
if not batched_summaries:
break
with graph_state.lock:
if self._use_core_quantile_ops:
graph_state.thread_hostile_merge_summary_callable(*result)
for summary in batched_summaries:
graph_state.thread_hostile_merge_summary_callable(*summary)
else:
graph_state.thread_hostile_merge_summary_callable(result)
for summary in batched_summaries:
graph_state.thread_hostile_merge_summary_callable(summary)
result = graph_state.thread_hostile_flush_summary_callable()
return result
def extract_output(self, summary):