8#include <initializer_list>
16 #include "backend/Storage.hpp"
40 void normal_(cytnx::Storage &Sin,
const double &mean,
const double &std,
56 void uniform_(cytnx::Storage &Sin,
const double &low = 0,
const double &high = 1,
139 Tensor normal(
const cytnx_uint64 &Nelem,
const double &mean,
const double &std,
140 const int &device =
Device.cpu,
142 const unsigned int &dtype =
Type.Double);
156 Tensor normal(
const std::vector<cytnx_uint64> &Nelem,
const double &mean,
const double &std,
157 const int &device =
Device.cpu,
159 const unsigned int &dtype =
Type.Double);
176 Tensor uniform(
const cytnx_uint64 &Nelem,
const double &low,
const double &high,
177 const int &device =
Device.cpu,
179 const unsigned int &dtype =
Type.Double);
194 Tensor uniform(
const std::vector<cytnx_uint64> &Nelem,
const double &low,
const double &high,
195 const int &device =
Device.cpu,
197 const unsigned int &dtype =
Type.Double);
213 const double &high = 10.0,
const int &device =
Device.cpu,
215 const unsigned int &dtype =
Type.Double);
220 void Make_normal(T &In,
const double &mean,
const double &std,
225 void Make_uniform(T &In,
const double &low,
const double &high,
constexpr Type_class Type
data type
Definition Type.hpp:426
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:2599
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
Tensor random_tensor(const std::vector< cytnx_uint64 > &shape, const double &low=-10.0, const double &high=10.0, const int &device=Device.cpu, const unsigned int &seed=__static_random_device(), const unsigned int &dtype=Type.Double)
create a Tensor with random values for any data type
Definition Accessor.hpp:12
Device_class Device
data on which devices.