def go(do_bug):
with nengo.Network() as model:
a = nengo.Ensemble(1, 1, label="a")
passthrough = nengo.Node(size_in=1, label="passthrough")
b = nengo.Ensemble(1, 1, label="b")
nengo.Connection(a, passthrough)
nengo.Connection(passthrough, b)
p = nengo.Probe(passthrough[0] if do_bug else passthrough)
with nengo_loihi.Simulator(model, remove_passthrough=True) as sim:
pass
go(False)
go(True)
AssertionError Traceback (most recent call last)
<ipython-input-1-bbe32de37e3c> in <module>()
21
22 go(False)
---> 23 go(True)
<ipython-input-1-bbe32de37e3c> in go(do_bug)
17 p = nengo.Probe(passthrough[0] if do_bug else passthrough)
18
---> 19 with nengo_loihi.Simulator(model, remove_passthrough=True) as sim:
20 pass
21
~/CTN/nengo-loihi/nengo_loihi/simulator.py in __init__(self, network, dt, seed, model, precompute, target, progress_bar, remove_passthrough)
328 node_neurons=self.model.node_neurons,
329 node_tau=self.model.decode_tau,
--> 330 remove_passthrough=remove_passthrough,
331 )
332 network = self.networks.chip
~/CTN/nengo-loihi/nengo_loihi/splitter.py in split(net, precompute, node_neurons, node_tau, remove_passthrough)
144
145 # --- Step 5: place probes
--> 146 place_probes(networks)
147
148 # Commit to the moves marked in the previous steps
~/CTN/nengo-loihi/nengo_loihi/splitter.py in place_probes(networks)
484 for probe in networks.original.all_probes:
485 target = base_obj(probe.target)
--> 486 networks.move(probe, networks.location(target))
487
488
~/CTN/nengo-loihi/nengo_loihi/splitter.py in move(self, obj, target, force)
99 if not force:
100 assert obj not in self, "already moved"
--> 101 assert target in self.targets, "invalid target"
102 logger.debug("Moving %s to %s", obj, target)
103 if obj in self.adds:
AssertionError: invalid target
The bug does not happen when remove_passthrough=False.
so that ObjView are resolved into their underlying base objects (as done in the splitter). Note the other base_obj calls are okay, because they all use pre_obj and post_obj which already resolve the ObjView.
Note this issue is somewhat independent of #205, as the latter bug occurs even when remove_passthrough=False.
The bug does not happen when
remove_passthrough=False
.I believe the fix is to change this line: https://github.com/nengo/nengo-loihi/blob/1517915baa1b0200e5241ba55a65e9d0bc09bff8/nengo_loihi/passthrough.py#L217
so that
ObjView
are resolved into their underlying base objects (as done in the splitter). Note the otherbase_obj
calls are okay, because they all usepre_obj
andpost_obj
which already resolve theObjView
.Note this issue is somewhat independent of #205, as the latter bug occurs even when
remove_passthrough=False
.