You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating an ensemble with a gain/bias distribution that results in a matrix (e.g. nengo.dists.Choice([[1.0]])) results in a cryptic build error (because the encoders end up being a 3-tensor):
File "workspace/nengo/nengo/builder/operator.py", line 539, in reshape_dot
"shape mismatch in %s: %s x %s -> %s" % (tag, A.shape, X.shape, Y.shape)
nengo.exceptions.BuildError: shape mismatch in <Ensemble (unlabeled) at 0x7fdb36501f98> encoding: (100, 100, 1) x (1,) -> (100,)
This has come up a few different places recently, we should add some better validation for Distributions in general (e.g. sample something from the dist and check the shape in the same way we do if a direct ndarray is used).
Describe the bug
Creating an ensemble with a gain/bias distribution that results in a matrix (e.g.
nengo.dists.Choice([[1.0]])
) results in a cryptic build error (because the encoders end up being a 3-tensor):To reproduce
Expected behavior
Ideally, we should catch this before build. Either way, the resulting error should clearly point to the problem.
We could also consider fixing this so the case where a 1-D vector is passed to
Choice
(as above) works.The text was updated successfully, but these errors were encountered: