Skip to content

Commit

Permalink
default to some value for empty sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
Doik committed Apr 18, 2016
1 parent 52b5314 commit 53ccb16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion micropsi_core/nodenet/theano_engine/theano_nodenet.py
Expand Up @@ -466,7 +466,8 @@ def merge_data(self, nodenet_data, keep_uids=False, native_module_instances_only
uidmap[self.rootpartition.rootnodespace_uid] = self.rootpartition.rootnodespace_uid

# make sure we have the partition NoNs large enough to store the native modules:
node_maxindex = max(n['index'] for n in nodenet_data.get('nodes', {}).values())
indexes = [n['index'] for n in nodenet_data.get('nodes', {}).values()]
node_maxindex = max(indexes) if indexes else 10
if self.rootpartition.NoN <= node_maxindex:
self.rootpartition.grow_number_of_nodes((node_maxindex - self.rootpartition.NoN) + 1)

Expand Down

0 comments on commit 53ccb16

Please sign in to comment.