7#include <initializer_list>
15 #include "backend/Storage.hpp"
39 void normal_(cytnx::Storage &Sin,
const double &mean,
const double &std,
55 void uniform_(cytnx::Storage &Sin,
const double &low = 0,
const double &high = 1,
139 const int &device =
Device.cpu,
141 const unsigned int &dtype =
Type.Double);
155 Tensor normal(
const std::vector<cytnx_uint64> &Nelem,
const double &mean,
const double &std,
156 const int &device =
Device.cpu,
158 const unsigned int &dtype =
Type.Double);
176 const int &device =
Device.cpu,
178 const unsigned int &dtype =
Type.Double);
193 Tensor uniform(
const std::vector<cytnx_uint64> &Nelem,
const double &low,
const double &high,
194 const int &device =
Device.cpu,
196 const unsigned int &dtype =
Type.Double);
202 void Make_normal(T &In,
const double &mean,
const double &std,
207 void Make_uniform(T &In,
const double &low,
const double &high,
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:1783
Tensor normal(const cytnx_uint64 &Nelem, const double &mean, const double &std, const int &device=Device.cpu, const unsigned int &seed=__static_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=__static_random_device(), const unsigned int &dtype=Type.Double)
create an Tensor with all the elements are initialized with uniform distribution
void normal_(cytnx::Storage &Sin, const double &mean, const double &std, const unsigned int &seed=__static_random_device())
Randomize the memory of a Storage with normal distributon.
void uniform_(cytnx::Storage &Sin, const double &low=0, const double &high=1, const unsigned int &seed=__static_random_device())
Randomize the memory of a Storage with uniform distributon.
std::random_device __static_random_device
Definition UniTensor.hpp:29
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