if pinstance.has_pattern() is False:
continue
self._pattern_instances[pattern_type].append(pinstance)
batch_stats = iutils.listify(pinstance.get_stats_from_batch())
n = len(computer_outputs)
self._work_sequence.append((n, n+len(batch_stats), pinstance))
computer_outputs += iutils.listify(batch_stats)
After Change
self._pattern_instances[pattern_type].append(pinstance)
dummy_output = pinstance.get_stats_from_batch()
// Broadcast dummy_output to right shape.
computer_outputs += iutils.listify(broadcast(dummy_output))
// initialize the keras outputs
self._n_computer_outputs = len(computer_outputs)
if self.compute_layers_in_parallel is True:
self._computers = [
keras.models.Model(inputs=model.inputs,
outputs=computer_outputs)
]
else:
self._computers = [
keras.models.Model(inputs=model.inputs,
outputs=computer_output)
for computer_output in computer_outputs
]
// distribute computation on more gpus