Skip to content

Commit

Permalink
Test conv weights without lowpass
Browse files Browse the repository at this point in the history
Covers some previously uncovered lines in `conv.py`.
  • Loading branch information
arvoelke authored and tbekolay committed Apr 15, 2019
1 parent 9a352ca commit 328f0b9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions nengo_loihi/tests/test_conv.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,3 +654,28 @@ def test_conv_gain(Simulator):
with pytest.raises(ValidationError):
with Simulator(net):
pass


@pytest.mark.skipif(nengo_transforms is None,
reason="Requires new nengo.transforms")
def test_conv_non_lowpass(Simulator):
k = 10
d = 5
with nengo.Network() as model:
a = nengo.Ensemble(n_neurons=k**2, dimensions=k)

x = nengo.Ensemble(n_neurons=d, dimensions=d,
gain=np.ones(d), bias=np.ones(d))

conv = nengo.Convolution(
n_filters=d, input_shape=(k, k, 1),
strides=(1, 1), kernel_size=(k, k))
assert conv.size_in == k**2
assert conv.size_out == d

nengo.Connection(a.neurons, x.neurons, transform=conv,
synapse=nengo.Alpha(0.005))

with pytest.raises(NotImplementedError, match="non-Lowpass synapses"):
with Simulator(model):
pass

0 comments on commit 328f0b9

Please sign in to comment.