as_variable

Contents

as_variable#

class brainpy.math.as_variable(tensor, dtype=None)[source]#

Convert the input to a brainpy.math.Variable.

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