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

Non-f-of-t Nodes break when fed into passthrough Nones #165

Open
tcstewar opened this issue Feb 20, 2017 · 0 comments · May be fixed by #166
Open

Non-f-of-t Nodes break when fed into passthrough Nones #165

tcstewar opened this issue Feb 20, 2017 · 0 comments · May be fixed by #166

Comments

@tcstewar
Copy link
Contributor

Here's a minimal example:

import nengo
import nengo_spinnaker
import numpy as np

model = nengo.Network()
with model:
    def stim_func(t):
        return np.sin(t), np.cos(t)
    stim = nengo.Node(stim_func)

    ea = nengo.networks.EnsembleArray(n_neurons=50, n_ensembles=2)
    nengo.Connection(stim, ea.input)

sim = nengo_spinnaker.Simulator(model)
sim.run(1)

and here's the error:

Building finished in 0:00:01.
Traceback (most recent call last):
  File "input_func_test.py", line 15, in <module>
    sim.run(1)
  File "/localhome/tcstewar/github/nengo_spinnaker/nengo_spinnaker/simulator.py", line 244, in run
    self.run_steps(steps)
  File "/localhome/tcstewar/github/nengo_spinnaker/nengo_spinnaker/simulator.py", line 250, in run_steps
    self._run_steps(n_steps)
  File "/localhome/tcstewar/github/nengo_spinnaker/nengo_spinnaker/simulator.py", line 300, in _run_steps
    self.host_sim.step()
  File "/localhome/tcstewar/github/nengo/nengo/simulator.py", line 308, in step
    step_fn()
  File "/localhome/tcstewar/github/nengo/nengo/builder/operator.py", line 626, in step_simpyfunc
    y = fn(t.item(), *args) if t is not None else fn(*args)
  File "/localhome/tcstewar/github/nengo_spinnaker/nengo_spinnaker/simulator.py", line 377, in func
    return f(t, x)
  File "/localhome/tcstewar/github/nengo_spinnaker/nengo_spinnaker/builder/node.py", line 340, in output
    self.controller.set_node_output(self.target, value)
  File "/localhome/tcstewar/github/nengo_spinnaker/nengo_spinnaker/node_io/ethernet.py", line 126, in set_node_output
    c_value = np.dot(transform, c_value)
ValueError: shapes (1,1) and (2,) not aligned: 1 (dim 1) != 2 (dim 0)

This doesn't happen if the input goes straight to an Ensemble, or if the input is marked as function_of_time=True.

@tcstewar tcstewar linked a pull request May 3, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant