8#include <initializer_list>
13#include "backend/Storage.hpp"
37 void normal_(cytnx::Storage &Sin,
const double &mean,
const double &std,
53 void uniform_(cytnx::Storage &Sin,
const double &low = 0,
const double &high = 1,
136 Tensor normal(
const cytnx_uint64 &Nelem,
const double &mean,
const double &std,
137 const int &device =
Device.cpu,
139 const unsigned int &dtype =
Type.Double);
153 Tensor normal(
const std::vector<cytnx_uint64> &Nelem,
const double &mean,
const double &std,
154 const int &device =
Device.cpu,
156 const unsigned int &dtype =
Type.Double);
173 Tensor uniform(
const cytnx_uint64 &Nelem,
const double &low,
const double &high,
174 const int &device =
Device.cpu,
176 const unsigned int &dtype =
Type.Double);
191 Tensor uniform(
const std::vector<cytnx_uint64> &Nelem,
const double &low,
const double &high,
192 const int &device =
Device.cpu,
194 const unsigned int &dtype =
Type.Double);
210 const double &high = 10.0,
const int &device =
Device.cpu,
212 const unsigned int &dtype =
Type.Double);
217 [[deprecated(
"Use random::normal_ instead")]]
void Make_normal(
218 T &In,
const double &mean,
const double &std,
223 [[deprecated(
"Use random::uniform_ instead")]]
void Make_uniform(
224 T &In,
const double &low,
const double &high,
constexpr Type_class Type
data type
Definition Type.hpp:553
an tensor (multi-dimensional array)
Definition Tensor.hpp:33
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:2773
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:27
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.