Skip to content

Commit

Permalink
Merge pull request #1400 from SpiNNakerManchester/fix_neuron_gen_global
Browse files Browse the repository at this point in the history
Fix issue with neuron generation global parameters
  • Loading branch information
rowleya committed Oct 10, 2023
2 parents 54fa554 + 0b18dcd commit c55ff8c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spynnaker/pyNN/utilities/struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ def get_generator_data(self, values, vertex_slice=None):
# We want the data generated "per neuron" regardless of how many -
# there must be a single value for this to work
if vertex_slice is None:
self.__gen_data_one_for_all(data, gen_data, values, name)
self.__gen_data_one_for_all(data, gen_data, values, name,
n_repeats)

# If we know the array size, the values can vary per neuron
else:
Expand All @@ -246,17 +247,16 @@ def get_generator_data(self, values, vertex_slice=None):
# Make it one
return numpy.concatenate(all_data)

def __gen_data_one_for_all(self, data, gen_data, values, name):
def __gen_data_one_for_all(self, data, gen_data, values, name, n_repeats):
"""
Generate data with a single value for all neurons.
"""
# How many sub-sets of repeats there are (1 in this case as
# that one sub-set covers all neurons)
data.append(1)

# How many times to repeat the next bit (once for each neuron
# which is determined at execution time)
data.append(REPEAT_PER_NEURON_FLAG)
# How many times to repeat the next bit
data.append(n_repeats)

# Get the value to write, of which there can only be one
# (or else there will be an error here ;)
Expand Down

0 comments on commit c55ff8c

Please sign in to comment.