From 971feeb38aea8af4fbd5a9ba92a1e536dce7b514 Mon Sep 17 00:00:00 2001 From: Terry Stewart Date: Wed, 3 May 2017 14:23:49 -0400 Subject: [PATCH] Fix slicing on inputs to nodes --- nengo_spinnaker/node_io/ethernet.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nengo_spinnaker/node_io/ethernet.py b/nengo_spinnaker/node_io/ethernet.py index e3ce4a7..0dfceac 100644 --- a/nengo_spinnaker/node_io/ethernet.py +++ b/nengo_spinnaker/node_io/ethernet.py @@ -100,6 +100,7 @@ def prepare(self, model, controller, netlist): # Store this transmission parameters to (x, y, p) map self._node_outgoing[node].append(( (transmission_params.pre_slice, + transmission_params.slice_in, transmission_params.function, transmission_params.full_transform(slice_out=False)), (x, y, p))) @@ -117,10 +118,12 @@ def set_node_output(self, node, value): """Transmit the value output by a Node.""" # Build an SDP packet to transmit for each outgoing connection for the # node - for (pre_slice, function, transform), (x, y, p) in \ + for (pre_slice, slice_in, function, transform), (x, y, p) in \ self._node_outgoing[node]: # Apply the pre-slice, the connection function and the transform. + c_value = value[pre_slice] + c_value = value[slice_in] if function is not None: c_value = function(c_value) c_value = np.dot(transform, c_value)