Array#

class brainpy.math.Array(value, dtype=None)[source]#

Multiple-dimensional array in BrainPy.

Compared to jax.Array, Array has the following advantages:

  • In-place updating is supported.

>>> import brainpy.math as bm
>>> a = bm.asarray([1, 2, 3.])
>>> a[0] = 10.
  • Keep sharding constraints during computation.

  • More dense array operations with PyTorch syntax.

as_variable()[source]#

As an instance of Variable.

fill_(fill_value)[source]#

Fill the array with a scalar value.

Parameters:

fill_value – the scalar value to fill the array.

update(value)[source]#

Update the value of this Array.