Cytnx v0.9.1
Loading...
Searching...
No Matches
Namespaces | Functions
random.hpp File Reference
#include "Type.hpp"
#include "Device.hpp"
#include "cytnx_error.hpp"
#include "Tensor.hpp"
#include "Storage.hpp"
#include "UniTensor.hpp"
#include <vector>
#include <initializer_list>
#include <random>
Include dependency graph for random.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  cytnx
 
namespace  cytnx::random
 The randomization related functions.
 

Functions

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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()(), const unsigned int &dtype=Type.Double)
 create an Tensor with all the elements are initialized with normal distribution
 
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()(), const unsigned int &dtype=Type.Double)
 create an Tensor with all the elements are initialized with normal distribution
 
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()(), const unsigned int &dtype=Type.Double)
 create an Tensor with all the elements are initialized with uniform distribution
 
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()(), const unsigned int &dtype=Type.Double)
 create an Tensor with all the elements are initialized with uniform distribution