Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedov committed Dec 21, 2015
2 parents 9c295fc + fe6c495 commit 4fec83d
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 2 deletions.
8 changes: 6 additions & 2 deletions neurokernel/LPU/LPU.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,11 @@ def __init__(self, dt, n_dict, s_dict, input_file=None, output_file=None,
n['num_dendrites_cond'] = Counter(n['cond_post'])
n['num_dendrites_I'] = Counter(n['I_post'])

s_id = np.concatenate([s['id'] for _, s in self.s_list]).astype(np.int32)
if len(self.s_list) > 0:
s_id = np.concatenate([s['id'] for _, s in self.s_list]).astype(np.int32)
else:
s_id = np.empty(0, dtype = np.int32)

s_order = np.arange(self.total_synapses)[s_id]
idx = np.where(cond_post >= self.nid_max)[0]
cond_post_syn = s_order[cond_post[idx] - self.nid_max]
Expand Down Expand Up @@ -775,7 +779,7 @@ def _initialize_gpu_ds(self):
"""

self.synapse_state = garray.zeros(
int(self.total_synapses) + len(self.input_neuron_list),
max(int(self.total_synapses) + len(self.input_neuron_list), 1),
np.float64)

if self.total_num_gpot_neurons > 0:
Expand Down

0 comments on commit 4fec83d

Please sign in to comment.