brainpy.math.as_numpy#

brainpy.math.as_numpy(tensor, dtype=None)#

Convert the input to a numpy.ndarray.

Parameters
  • tensor (array_like) – Input data, in any form that can be converted to an array. This includes lists, lists of tuples, tuples, tuples of tuples, tuples of lists, ArrayType.

  • dtype (data-type, optional) – By default, the data-type is inferred from the input data.

Returns

out – Array interpretation of tensor. No copy is performed if the input is already an ndarray with matching dtype.

Return type

ndarray