Skip to content

Commit

Permalink
Merge pull request #1185 from rizar/postpone_compilation
Browse files Browse the repository at this point in the history
Postpost compilation in DatasetEvaluator
  • Loading branch information
rizar committed Mar 30, 2017
2 parents 4232f93 + a13a02a commit 6b0acfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/monitoring/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ def __init__(self, variables, updates=None):
self.monitored_quantities_buffer = MonitoredQuantityBuffer(
monitored_quantities)
self.updates = updates
self._compile()

def _compile(self):
"""Compiles Theano functions.
Expand Down Expand Up @@ -332,6 +331,8 @@ def evaluate(self, data_stream):
"""
self.initialize_aggregators()
if not hasattr(self, '_aggregate_fun'):
self._compile()
if self._aggregate_fun is not None:
for batch in data_stream.get_epoch_iterator(as_dict=True):
self.process_batch(batch)
Expand Down

0 comments on commit 6b0acfc

Please sign in to comment.