(self)
| 9 | """ |
| 10 | |
| 11 | def test_bernoulli(self): |
| 12 | for n in [1, 100]: # number of nodes in layer |
| 13 | for t in [1, 100]: # number of timesteps |
| 14 | for m in [0.1, 1.0]: # maximum spiking probability |
| 15 | datum = torch.empty(n).uniform_(0, m) |
| 16 | spikes = bernoulli(datum, time=t, max_prob=m) |
| 17 | |
| 18 | assert spikes.size() == torch.Size((t, n)) |
| 19 | |
| 20 | def test_multidim_bernoulli(self): |
| 21 | for shape in [[5, 5], [10, 10], [25, 25]]: # shape of nodes in layer |
nothing calls this directly
no test coverage detected