5.2. clumsygrad.random#

clumsygrad.random.rand(shape: tuple[int, ...], tensor_type: TensorType = TensorType.INPUT) → Tensor[source]#

Create a new tensor with random values.

Parameters:
  • shape – The shape of the tensor to create.

  • tensor_type – The type of the tensor.

Returns:

A new Tensor instance with random values.

clumsygrad.random.randn(shape: tuple[int, ...], tensor_type: TensorType = TensorType.INPUT) → Tensor[source]#

Create a new tensor with random values from a normal distribution.

Parameters:
  • shape – The shape of the tensor to create.

  • tensor_type – The type of the tensor.

Returns:

A new Tensor instance with random values from a normal distribution.