vt::normal#

template<typename T = float, size_t N>
Tensor<T, N> vt::random::normal(Shape<N> shape, T mean = T{0.0}, T stddev = T{1.0}, const Order order = Order::C, curandGenerator_t gen = cuda::curand.get_handle())#

Generate a tensor of random numbers from a normal distribution.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • shape – Shape of the tensor.

  • mean – Mean of the normal distribution.

  • stddev – Standard deviation of the normal distribution.

  • order – Order of the tensor.

  • gen – The CuRand generator. The default is the global CuRand generator.

Returns:

Tensor<T, N>: The tensor of random numbers.

template<typename T = float>
Tensor<T, 1> vt::random::normal(size_t m, T mean = T{0.0}, T stddev = T{1.0}, const Order order = Order::C, curandGenerator_t gen = cuda::curand.get_handle())#

Generate a 1D tensor of random numbers from a normal distribution.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • m – Size of the tensor.

  • mean – Mean of the normal distribution.

  • stddev – Standard deviation of the normal distribution.

  • order – Order of the tensor.

  • gen – The CuRand generator. The default is the global CuRand generator.

Returns:

Tensor<T, 1>: The tensor of random numbers.

template<typename T = float>
Tensor<T, 2> vt::random::normal(size_t m, size_t n, T mean = T{0.0}, T stddev = T{1.0}, const Order order = Order::C, curandGenerator_t gen = cuda::curand.get_handle())#

Generate a 2D tensor of random numbers from a normal distribution.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • m – Number of rows of the tensor.

  • n – Number of columns of the tensor.

  • mean – Mean of the normal distribution.

  • stddev – Standard deviation of the normal distribution.

  • order – Order of the tensor.

  • gen – The CuRand generator. The default is the global CuRand generator.

Returns:

Tensor<T, 2>: The tensor of random numbers.