|
Cytnx v0.7.4
|
Functions | |
| void | Make_normal (Storage &Sin, const double &mean, const double &std, const unsigned int &seed=std::random_device()()) |
| Randomize the memory of a Storage with normal distributon. | |
| void | Make_uniform (Storage &Sin, const double &low=0, const double &high=1, const unsigned int &seed=std::random_device()()) |
| Randomize the memory of a Storage with uniform distributon. | |
| void | Make_normal (Tensor &Tin, const double &mean, const double &std, const unsigned int &seed=std::random_device()()) |
| Randomize the memory of a Tensor with normal distributon. | |
| void | Make_uniform (Tensor &Tin, const double &low=0, const double &high=1, const unsigned int &seed=std::random_device()()) |
| Randomize the memory of a Tensor with uniform distributon. | |
| void | Make_normal (UniTensor &Tin, const double &mean, const double &std, const unsigned int &seed=std::random_device()()) |
| Randomize the memory of a UniTensor with normal distributon. | |
| void | Make_uniform (UniTensor &Tin, const double &low=0, const double &high=1, const unsigned int &seed=std::random_device()()) |
| Randomize the memory of a UniTensor with uniform distributon. | |
| Tensor | normal (const cytnx_uint64 &Nelem, const double &mean, const double &std, const int &device=Device.cpu, const unsigned int &seed=std::random_device()()) |
| create an Tensor with all the elements are initialized with normal distribution | |
| Tensor | normal (const std::vector< cytnx_uint64 > &Nelem, const double &mean, const double &std, const int &device=Device.cpu, const unsigned int &seed=std::random_device()()) |
| create an Tensor with all the elements are initialized with normal distribution | |
| Tensor | uniform (const cytnx_uint64 &Nelem, const double &low, const double &high, const int &device=Device.cpu, const unsigned int &seed=std::random_device()()) |
| create an Tensor with all the elements are initialized with uniform distribution | |
| Tensor | uniform (const std::vector< cytnx_uint64 > &Nelem, const double &low, const double &high, const int &device=Device.cpu, const unsigned int &seed=std::random_device()()) |
| create an Tensor with all the elements are initialized with uniform distribution | |
| void cytnx::random::Make_normal | ( | Storage & | Sin, |
| const double & | mean, | ||
| const double & | std, | ||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
Randomize the memory of a Storage with normal distributon.
| Sin | a Storage |
| mean | the mean of a normal distribution |
| std | the standard deviation (sigma) of a normal distribution. |
| seed | the seed for the random generator. [Default] Using device entropy. [Note] The Storage sould be real floating type or complex type. |
| void cytnx::random::Make_normal | ( | Tensor & | Tin, |
| const double & | mean, | ||
| const double & | std, | ||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
Randomize the memory of a Tensor with normal distributon.
| Tin | a Tensor |
| mean | the mean of a normal distribution |
| std | the standard deviation (sigma) of a normal distribution. |
| seed | the seed for the random generator. [Default] Using device entropy. [Note] The Tensor sould be real floating type or complex type. |
| void cytnx::random::Make_normal | ( | UniTensor & | Tin, |
| const double & | mean, | ||
| const double & | std, | ||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
Randomize the memory of a UniTensor with normal distributon.
| Tin | a UniTensor |
| mean | the mean of a normal distribution |
| std | the standard deviation (sigma) of a normal distribution. |
| seed | the seed for the random generator. [Default] Using device entropy. [Note] The UniTensor sould be real floating type or complex type. |
| void cytnx::random::Make_uniform | ( | Storage & | Sin, |
| const double & | low = 0, |
||
| const double & | high = 1, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
Randomize the memory of a Storage with uniform distributon.
| Sin | a Storage |
| low | the lower-bound of the uniform distribution |
| high | the higher-bound of the uniform distribution |
| seed | the seed for the random generator. [Default] Using device entropy. [Note]
1. The Storage sould be real floating type or complex type.
2. In cpu, it generate random number in domain [low,high); but in gpu(cuda), it generate random number in domain (low,high]; (cuRandv10)
|
| void cytnx::random::Make_uniform | ( | Tensor & | Tin, |
| const double & | low = 0, |
||
| const double & | high = 1, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
Randomize the memory of a Tensor with uniform distributon.
| Tin | a Tensor |
| low | the lower-bound of the uniform distribution |
| high | the higher-bound of the uniform distribution |
| seed | the seed for the random generator. [Default] Using device entropy. [Note]
1. The Tensor sould be real floating type or complex type.
2. In cpu, it generate random number in domain [low,high); but in gpu(cuda), it generate random number in domain (low,high]; (cuRandv10)
|
| void cytnx::random::Make_uniform | ( | UniTensor & | Tin, |
| const double & | low = 0, |
||
| const double & | high = 1, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
Randomize the memory of a UniTensor with uniform distributon.
| Tin | a UniTensor |
| low | the lower-bound of the uniform distribution |
| high | the higher-bound of the uniform distribution |
| seed | the seed for the random generator. [Default] Using device entropy. [Note]
1. The UniTensor sould be real floating type or complex type.
2. In cpu, it generate random number in domain [low,high); but in gpu(cuda), it generate random number in domain (low,high]; (cuRandv10)
|
| Tensor cytnx::random::normal | ( | const cytnx_uint64 & | Nelem, |
| const double & | mean, | ||
| const double & | std, | ||
| const int & | device = Device.cpu, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
create an Tensor with all the elements are initialized with normal distribution
| Nelem | the number of elements |
| mean | the mean of the normal distribution |
| std | the standard deviation (sigma) of the normal distribution |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| seed | the seed for the random generator. [Default] using device entropy |
| Tensor cytnx::random::normal | ( | const std::vector< cytnx_uint64 > & | Nelem, |
| const double & | mean, | ||
| const double & | std, | ||
| const int & | device = Device.cpu, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
create an Tensor with all the elements are initialized with normal distribution
| Nelem | the shape of the Tensor |
| mean | the mean of the normal distribution |
| std | the standard deviation (sigma) of the normal distribution |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| seed | the seed for the random generator. [Default] using device entropy |
| Tensor cytnx::random::uniform | ( | const cytnx_uint64 & | Nelem, |
| const double & | low, | ||
| const double & | high, | ||
| const int & | device = Device.cpu, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
create an Tensor with all the elements are initialized with uniform distribution
| Nelem | the number of elements |
| low | the lower-bound of range |
| high | the upper-bound of range |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| seed | the seed for the random generator. [Default] using device entropy |
| Tensor cytnx::random::uniform | ( | const std::vector< cytnx_uint64 > & | Nelem, |
| const double & | low, | ||
| const double & | high, | ||
| const int & | device = Device.cpu, |
||
| const unsigned int & | seed = std::random_device()() |
||
| ) |
create an Tensor with all the elements are initialized with uniform distribution
| Nelem | the number of elements |
| low | the lower-bound of range |
| high | the upper-bound of range |
| device | the device that the Tensor is put on. It can be any device defined in cytnx::Device |
| seed | the seed for the random generator. [Default] using device entropy |