Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slicing on inputs to nodes #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion nengo_spinnaker/node_io/ethernet.py
Expand Up @@ -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)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you might be able to get away with just adding slice_pre=False to this call.

(x, y, p)))
Expand All @@ -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)
Expand Down