File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ def _check_tracer(self):
98
98
self_value = self .value
99
99
if hasattr (self_value , '_trace' ) and hasattr (self_value ._trace .main , 'jaxpr_stack' ):
100
100
if len (self_value ._trace .main .jaxpr_stack ) == 0 :
101
- raise RuntimeError ('This Array is modified during the transformation. '
101
+ raise jax . errors . UnexpectedTracerError ('This Array is modified during the transformation. '
102
102
'BrainPy only supports transformations for Variable. '
103
103
'Please declare it as a Variable.' ) from jax .core .escaped_tracer_error (self_value , None )
104
104
return self_value
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def _f(self, b):
62
62
63
63
def test_tracing (self ):
64
64
print (self .f (1. ))
65
- with self .assertRaises (RuntimeError ):
65
+ with self .assertRaises (jax . errors . UnexpectedTracerError ):
66
66
print (self .f (bm .ones (10 )))
67
67
68
68
You can’t perform that action at this time.
0 commit comments