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

Empty probes are Python lists instead of ndarrays #200

Open
arvoelke opened this issue Jan 20, 2021 · 0 comments
Open

Empty probes are Python lists instead of ndarrays #200

arvoelke opened this issue Jan 20, 2021 · 0 comments

Comments

@arvoelke
Copy link
Contributor

This is very minor but it's a difference between nengo and nengo_dl that might crop up in rare/special circumstances (discovered when looping and resetting probes inside of the simulator context).

In Nengo an empty probe array is a NumPy ndarray. But in NengoDL it is a Python list. I'd expect the behaviour to be the same with the NengoDL simulator since it is a drop-in replacement.

A minimal example:

import nengo
import nengo_dl

with nengo.Network() as model:
    p = nengo.Probe(nengo.Node(0))

with nengo_dl.Simulator(model) as sim:
    # sim.step()
    print(sim.data[p].shape)

Raises: AttributeError: 'list' object has no attribute 'shape'.

Switching nengo_dl.Simulator to nengo.Simulator instead outputs the shape: (0,).

Likewise, uncommenting the sim.step() (with either simulator) outputs the shape: (1, 1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant