Variable#
- class brainpy.math.Variable(value_or_size, dtype=None, batch_axis=None, *, axis_names=None, ready_to_trace=None)[source]#
The pointer to specify the dynamical variable.
Initializing an instance of
Variable
by two ways:>>> import brainpy.math as bm >>> # 1. init a Variable by the concreate data >>> v1 = bm.Variable(bm.zeros(10)) >>> # 2. init a Variable by the data shape >>> v2 = bm.Variable(10)
Note that when initializing a Variable by the data shape, all values in this Variable will be initialized as zeros.
- Parameters: