randn_like

Contents

randn_like#

class brainstate.random.randn_like(input, *, dtype=None, key=None)#

Similar to randn_like in torch.

Returns a tensor with the same size as input that is filled with random numbers from a normal distribution with mean 0 and variance 1.

Parameters:
  • input (Array | ndarray | bool | number | bool | int | float | complex | Quantity) – the size of input will determine size of the output tensor.

  • dtype (str | type[Any] | dtype | SupportsDType | None) – the desired data type of returned Tensor. Default: if None, defaults to the dtype of input.

  • key (int | Array | ndarray | None) – the seed or key for the random.

Return type:

Array