7#include <initializer_list>
15 #include "backend/Storage.hpp"
37 void normal_(Storage &Sin,
const double &mean,
const double &std,
38 const unsigned int &seed = std::random_device()());
53 void uniform_(Storage &Sin,
const double &low = 0,
const double &high = 1,
54 const unsigned int &seed = std::random_device()());
70 const unsigned int &seed = std::random_device()());
87 const unsigned int &seed = std::random_device()());
103 const unsigned int &seed = std::random_device()());
119 const unsigned int &seed = std::random_device()());
137 const int &device =
Device.cpu,
const unsigned int &seed = std::random_device()(),
138 const unsigned int &dtype =
Type.Double);
152 Tensor normal(
const std::vector<cytnx_uint64> &Nelem,
const double &mean,
const double &std,
153 const int &device =
Device.cpu,
const unsigned int &seed = std::random_device()(),
154 const unsigned int &dtype =
Type.Double);
172 const int &device =
Device.cpu,
173 const unsigned int &seed = std::random_device()(),
174 const unsigned int &dtype =
Type.Double);
189 Tensor uniform(
const std::vector<cytnx_uint64> &Nelem,
const double &low,
const double &high,
190 const int &device =
Device.cpu,
191 const unsigned int &seed = std::random_device()(),
192 const unsigned int &dtype =
Type.Double);
198 void Make_normal(T &In,
const double &mean,
const double &std,
199 const unsigned int &seed = std::random_device()()) {
203 void Make_uniform(T &In,
const double &low,
const double &high,
204 const unsigned int &seed = std::random_device()()) {
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:1706
Tensor 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 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
void 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 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.
Helper function to print vector with ODT:
Definition Accessor.hpp:12
Device_class Device
data on which devices.
uint64_t cytnx_uint64
Definition Type.hpp:55