DLPrimitives
initialization.hpp
1 #pragma once
2 #include <dlprim/context.hpp>
3 #include <dlprim/tensor.hpp>
4 namespace dlprim {
5  class RandomState;
6 
10  void set_to_zero(Tensor &t,ExecutionContext const &e);
14  void set_to_constant(Tensor &t,double value,ExecutionContext const &e);
18 
19  void set_to_urandom(Tensor &t,RandomState &state,float minv,float maxv,ExecutionContext const &e);
20 
24  void set_to_normal(Tensor &t,RandomState &state,float mean,float sigma,ExecutionContext const &e);
28  void set_to_bernoulli(Tensor &t,RandomState &state,float p,ExecutionContext const &e);
29 
30 }
void set_to_normal(Tensor &t, RandomState &state, float mean, float sigma, ExecutionContext const &e)
set t values to normal distribution with mean and sigma), seed is updated
void set_to_zero(Tensor &t, ExecutionContext const &e)
Set value of t to zero.
void set_to_urandom(Tensor &t, RandomState &state, float minv, float maxv, ExecutionContext const &e)
set t values to uniform random values in range [minv,maxv), seed is updated
void set_to_bernoulli(Tensor &t, RandomState &state, float p, ExecutionContext const &e)
set t values to bernully distribution with mean and sigma), seed is updated
Mane namespace.
Definition: context.hpp:9
void set_to_constant(Tensor &t, double value, ExecutionContext const &e)
Set to constant, value is casted to t.dtype()