Skip to content

Commit 425f355

Browse files
committed
fix test bugs
1 parent 4b967ea commit 425f355

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

brainpy/_src/math/object_transform/tests/test_jit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __call__(self):
3737
self.b += a
3838
return self.b
3939

40-
@bm.cls_jit_inline
40+
@bm.cls_jit(inline=True)
4141
def update(self, x):
4242
self.b += x
4343

brainpy/_src/math/tests/test_op_register.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def event_sum_op(outs, ins):
3131
event_sum2 = bm.XLACustomOp(name='event_sum2', cpu_func=event_sum_op, eval_shape=abs_eval)
3232

3333

34-
class ExponentialSyn(bp.dyn.TwoEndConn):
34+
class ExponentialSyn(bp.TwoEndConn):
3535
def __init__(self, pre, post, conn, g_max=1., delay=0., tau=8.0, E=0.,
3636
method='exp_auto'):
3737
super(ExponentialSyn, self).__init__(pre=pre, post=post, conn=conn)
@@ -57,7 +57,7 @@ def update(self, tdi):
5757
self.post.input += self.g * (self.E - self.post.V)
5858

5959

60-
class ExponentialSyn3(bp.dyn.TwoEndConn):
60+
class ExponentialSyn3(bp.TwoEndConn):
6161
def __init__(self, pre, post, conn, g_max=1., delay=0., tau=8.0, E=0.,
6262
method='exp_auto'):
6363
super(ExponentialSyn3, self).__init__(pre=pre, post=post, conn=conn)
@@ -88,7 +88,7 @@ def update(self, tdi):
8888
self.post.input += self.g * (self.E - self.post.V)
8989

9090

91-
class EINet(bp.dyn.Network):
91+
class EINet(bp.Network):
9292
def __init__(self, syn_class, scale=1.0, method='exp_auto', ):
9393
super(EINet, self).__init__()
9494

@@ -113,13 +113,12 @@ def __init__(self, syn_class, scale=1.0, method='exp_auto', ):
113113
self.I2I = syn_class(self.I, self.I, bp.conn.FixedProb(0.02), E=-80., g_max=wi, tau=10., method=method)
114114

115115

116-
class TestOpRegister(unittest.TestCase):
116+
class TestOpRegister(bp.testing.UnitTestCase):
117117
def test_op(self):
118-
119118
fig, gs = bp.visualize.get_figure(1, 2, 4, 5)
120119

121120
net = EINet(ExponentialSyn, scale=1., method='euler')
122-
runner = bp.dyn.DSRunner(
121+
runner = bp.DSRunner(
123122
net,
124123
inputs=[(net.E.input, 20.),
125124
(net.I.input, 20.)],
@@ -131,7 +130,7 @@ def test_op(self):
131130
bp.visualize.raster_plot(runner.mon.ts, runner.mon['E.spike'], ax=ax)
132131

133132
net3 = EINet(ExponentialSyn3, scale=1., method='euler')
134-
runner3 = bp.dyn.DSRunner(
133+
runner3 = bp.DSRunner(
135134
net3,
136135
inputs=[(net3.E.input, 20.),
137136
(net3.I.input, 20.)],

0 commit comments

Comments
 (0)