clumsygrad.random

Contents

3.1.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 (default is INPUT).

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 (default is INPUT).

Returns:

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