Dragon - C++ API
A Computation Graph Virtual Machine Based Deep Learning Framework
Functions
dragon::math Namespace Reference

Functions

template<typename T , class Context >
void Copy (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Exp (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Log (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Inv (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Sqrt (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void RSqrt (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Square (const int n, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Set (const int n, const T alpha, T *y, Context *ctx)
 
template<typename T , class Context >
void BroadcastSet (const int rows, const int cols, const int type, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Pow (const int n, const float exp, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Scale (const int n, const float alpha, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Axpy (const int n, const float alpha, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Axpby (const int n, const float alpha, const T *x, const float beta, T *y, Context *ctx)
 
template<typename T , class Context >
void AddScalar (const int n, const float alpha, T *y, Context *ctx)
 
template<typename T , class Context >
void InvStd (const int n, const float eps, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
void Sum (const int n, const float alpha, const T *x, T *y, Context *ctx)
 
template<typename T , class Context >
Sum (const int n, const float alpha, const T *x, Context *ctx)
 
template<typename T , class Context >
ASum (const int n, const T *x, Context *ctx)
 
template<typename T , class Context >
void Add (const int n, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void Sub (const int n, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void Mul (const int n, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void Div (const int n, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void Dot (const int n, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void BroadcastAdd (const int rows, const int cols, const int type, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void BroadcastSub (const int rows, const int cols, const int type, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void BroadcastMul (const int rows, const int cols, const int type, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void BroadcastDiv (const int rows, const int cols, const int type, const T *a, const T *b, T *y, Context *ctx)
 
template<typename T , class Context >
void Gemm (const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const float alpha, const T *A, const T *B, const float beta, T *C, Context *ctx, TensorProto_DataType math_type=TensorProto_DataType_FLOAT)
 
template<typename T , class Context >
void Gemv (const CBLAS_TRANSPOSE TransA, const int M, const int N, const float alpha, const T *A, const T *x, const float beta, T *y, Context *ctx, TensorProto_DataType math_type=TensorProto_DataType_FLOAT)
 
template<typename T , class Context >
void RandomUniform (const int n, const float low, const float high, T *y, Context *ctx)
 
template<typename T , class Context >
void RandomNormal (const int n, const float mu, const float sigma, T *y, Context *ctx)
 
template<typename T , class Context >
void RandomTruncatedNormal (const int n, const float mu, const float sigma, const float low, const float high, T *y, Context *ctx)
 
template<typename T , class Context >
void RandomBernoulli (const int n, const float p, T *y, Context *ctx)
 
 DEFINE_COPY_FUNC (bool)
 
 DEFINE_COPY_FUNC (int8_t)
 
 DEFINE_COPY_FUNC (uint8_t)
 
 DEFINE_COPY_FUNC (int)
 
 DEFINE_COPY_FUNC (int64_t)
 
 DEFINE_COPY_FUNC (float16)
 
 DEFINE_COPY_FUNC (float)
 
 DEFINE_COPY_FUNC (double)
 
 DEFINE_SIMPLE_UNARY_FUNC (Exp, float, exp)
 
 DEFINE_SIMPLE_UNARY_FUNC (Exp, double, exp)
 
 DEFINE_SIMPLE_UNARY_FUNC (Log, float, log)
 
 DEFINE_SIMPLE_UNARY_FUNC (Log, double, log)
 
 DEFINE_SIMPLE_UNARY_FUNC (Inv, float, inverse)
 
 DEFINE_SIMPLE_UNARY_FUNC (Inv, double, inverse)
 
 DEFINE_SIMPLE_UNARY_FUNC (Sqrt, float, sqrt)
 
 DEFINE_SIMPLE_UNARY_FUNC (Sqrt, double, sqrt)
 
 DEFINE_SIMPLE_UNARY_FUNC (RSqrt, float, rsqrt)
 
 DEFINE_SIMPLE_UNARY_FUNC (RSqrt, double, rsqrt)
 
 DEFINE_SIMPLE_UNARY_FUNC (Square, int8_t, square)
 
 DEFINE_SIMPLE_UNARY_FUNC (Square, uint8_t, square)
 
 DEFINE_SIMPLE_UNARY_FUNC (Square, int, square)
 
 DEFINE_SIMPLE_UNARY_FUNC (Square, int64_t, square)
 
 DEFINE_SIMPLE_UNARY_FUNC (Square, float, square)
 
 DEFINE_SIMPLE_UNARY_FUNC (Square, double, square)
 
 DEFINE_SET_FUNC (bool)
 
 DEFINE_SET_FUNC (int8_t)
 
 DEFINE_SET_FUNC (uint8_t)
 
 DEFINE_SET_FUNC (int)
 
 DEFINE_SET_FUNC (int64_t)
 
 DEFINE_SET_FUNC (float)
 
 DEFINE_SET_FUNC (double)
 
 DEFINE_BROADCAST_SET_FUNC (bool)
 
 DEFINE_BROADCAST_SET_FUNC (int8_t)
 
 DEFINE_BROADCAST_SET_FUNC (uint8_t)
 
 DEFINE_BROADCAST_SET_FUNC (int)
 
 DEFINE_BROADCAST_SET_FUNC (int64_t)
 
 DEFINE_BROADCAST_SET_FUNC (float16)
 
 DEFINE_BROADCAST_SET_FUNC (float)
 
 DEFINE_BROADCAST_SET_FUNC (double)
 
 DEFINE_POWX_FUNC (float)
 
 DEFINE_POWX_FUNC (double)
 
 DEFINE_SCALE_FUNC (int8_t)
 
 DEFINE_SCALE_FUNC (uint8_t)
 
 DEFINE_SCALE_FUNC (int)
 
 DEFINE_SCALE_FUNC (int64_t)
 
 DEFINE_SCALE_FUNC (float)
 
 DEFINE_SCALE_FUNC (double)
 
 DEFINE_AXPY_FUNC (int8_t)
 
 DEFINE_AXPY_FUNC (uint8_t)
 
 DEFINE_AXPY_FUNC (int)
 
 DEFINE_AXPY_FUNC (int64_t)
 
 DEFINE_AXPY_FUNC (float)
 
 DEFINE_AXPY_FUNC (double)
 
 DEFINE_AXPBY_FUNC (int8_t)
 
 DEFINE_AXPBY_FUNC (uint8_t)
 
 DEFINE_AXPBY_FUNC (int)
 
 DEFINE_AXPBY_FUNC (int64_t)
 
 DEFINE_AXPBY_FUNC (float16)
 
 DEFINE_AXPBY_FUNC (float)
 
 DEFINE_AXPBY_FUNC (double)
 
 DEFINE_ADD_SCALAR_FUNC (int8_t)
 
 DEFINE_ADD_SCALAR_FUNC (uint8_t)
 
 DEFINE_ADD_SCALAR_FUNC (int)
 
 DEFINE_ADD_SCALAR_FUNC (int64_t)
 
 DEFINE_ADD_SCALAR_FUNC (float)
 
 DEFINE_ADD_SCALAR_FUNC (double)
 
 DEFINE_INVSTD_FUNC (float)
 
 DEFINE_INVSTD_FUNC (double)
 
 DEFINE_SUM_FUNC (int8_t)
 
 DEFINE_SUM_FUNC (uint8_t)
 
 DEFINE_SUM_FUNC (int)
 
 DEFINE_SUM_FUNC (int64_t)
 
 DEFINE_SUM_FUNC (float)
 
 DEFINE_SUM_FUNC (double)
 
 DEFINE_ASUM_FUNC (float)
 
 DEFINE_ASUM_FUNC (double)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add, int8_t,+)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add, uint8_t,+)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add, int,+)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add, int64_t,+)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add, float,+)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add, double,+)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub, int8_t, -)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub, uint8_t, -)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub, int, -)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub, int64_t, -)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub, float, -)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub, double, -)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul, int8_t, *)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul, uint8_t, *)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul, int, *)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul, int64_t, *)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul, float, *)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul, double, *)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div, int8_t,/)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div, uint8_t,/)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div, int,/)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div, int64_t,/)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div, float,/)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div, double,/)
 
 DEFINE_DOT_FUNC (float)
 
 DEFINE_DOT_FUNC (double)
 
 DEFINE_BROADCAST_BINARY_FUNCTOR (Add)
 
 DEFINE_BROADCAST_BINARY_FUNCTOR (Sub)
 
 DEFINE_BROADCAST_BINARY_FUNCTOR (Mul)
 
 DEFINE_BROADCAST_BINARY_FUNCTOR (Div)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add, int8_t,+)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add, uint8_t,+)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add, int,+)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add, int64_t,+)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add, float,+)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add, double,+)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub, int8_t, -)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub, uint8_t, -)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub, int, -)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub, int64_t, -)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub, float, -)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub, double, -)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul, int8_t, *)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul, uint8_t, *)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul, int, *)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul, int64_t, *)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul, float, *)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul, double, *)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div, int8_t,/)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div, uint8_t,/)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div, int,/)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div, int64_t,/)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div, float,/)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div, double,/)
 
 DEFINE_GEMM_FUNC (float)
 
 DEFINE_GEMM_FUNC (double)
 
 DEFINE_GEMV_FUNC (float)
 
 DEFINE_GEMV_FUNC (double)
 
 DEFINE_RANDOM_UNIFORM_FUNC (uint32_t, int)
 
 DEFINE_RANDOM_UNIFORM_FUNC (float, real)
 
 DEFINE_RANDOM_UNIFORM_FUNC (double, real)
 
 DEFINE_RANDOM_NORMAL_FUNC (float)
 
 DEFINE_RANDOM_NORMAL_FUNC (double)
 
 DEFINE_RANDOM_TRUNCATED_NORMAL_FUNC (float)
 
 DEFINE_RANDOM_TRUNCATED_NORMAL_FUNC (double)
 
 DEFINE_RANDOM_BERNOULI_FUNC (uint8_t)
 
 DEFINE_RANDOM_BERNOULI_FUNC (uint32_t)
 
 DEFINE_RANDOM_BERNOULI_FUNC (float)
 
template<>
void Exp< float16, CPUContext > (int n, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Log< float16, CPUContext > (int n, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Inv< float16, CPUContext > (const int n, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Sqrt< float16, CPUContext > (int n, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void RSqrt< float16, CPUContext > (int n, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Square< float16, CPUContext > (int n, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Set< float16, CPUContext > (const int n, const float16 alpha, float16 *y, CPUContext *ctx)
 
template<>
void Pow< float16, CPUContext > (int n, const float alpha, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Scale< float16, CPUContext > (const int n, const float alpha, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Axpy< float16, CPUContext > (const int n, float alpha, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void AddScalar< float16, CPUContext > (const int n, const float alpha, float16 *y, CPUContext *ctx)
 
template<>
void InvStd< float16, CPUContext > (const int n, const float eps, const float16 *x, float16 *y, CPUContext *ctx)
 
template<>
void Sum< float16, CPUContext > (const int n, const float alpha, const float16 *x, float16 *y, CPUContext *ctx)
 
 DEFINE_SIMPLE_BINARY_FUNC (Add)
 
 DEFINE_SIMPLE_BINARY_FUNC (Sub)
 
 DEFINE_SIMPLE_BINARY_FUNC (Mul)
 
 DEFINE_SIMPLE_BINARY_FUNC (Div)
 
template<>
void Dot< float16, CPUContext > (int n, const float16 *a, const float16 *b, float16 *y, CPUContext *ctx)
 
 DEFINE_BROADCAST_BINARY_FUNC (Add)
 
 DEFINE_BROADCAST_BINARY_FUNC (Sub)
 
 DEFINE_BROADCAST_BINARY_FUNC (Mul)
 
 DEFINE_BROADCAST_BINARY_FUNC (Div)
 
template<>
void Gemm< float16, CPUContext > (const CBLAS_TRANSPOSE TransA, const CBLAS_TRANSPOSE TransB, const int M, const int N, const int K, const float alpha, const float16 *A, const float16 *B, const float beta, float16 *C, CPUContext *ctx, TensorProto_DataType math_type)
 
template<>
void Gemv< float16, CPUContext > (const CBLAS_TRANSPOSE TransA, const int M, const int N, const float alpha, const float16 *A, const float16 *x, const float beta, float16 *y, CPUContext *ctx, TensorProto_DataType math_type)
 
template<>
void RandomUniform< float16, CPUContext > (const int n, const float low, const float high, float16 *x, CPUContext *ctx)
 
template<>
void RandomNormal< float16, CPUContext > (const int n, const float mu, const float sigma, float16 *x, CPUContext *ctx)
 
template<>
void RandomTruncatedNormal< float16, CPUContext > (const int n, const float mu, const float sigma, const float low, const float high, float16 *x, CPUContext *ctx)
 

Function Documentation

◆ Add()

template<typename T , class Context >
void dragon::math::Add ( const int  n,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

       Simply Binary Functions

◆ AddScalar()

template<typename T , class Context >
void dragon::math::AddScalar ( const int  n,
const float  alpha,
T *  y,
Context *  ctx 
)

◆ AddScalar< float16, CPUContext >()

template<>
void dragon::math::AddScalar< float16, CPUContext > ( const int  n,
const float  alpha,
float16 *  y,
CPUContext ctx 
)

y += a

◆ ASum()

template<typename T , class Context >
T dragon::math::ASum ( const int  n,
const T *  x,
Context *  ctx 
)

◆ Axpby()

template<typename T , class Context >
void dragon::math::Axpby ( const int  n,
const float  alpha,
const T *  x,
const float  beta,
T *  y,
Context *  ctx 
)

◆ Axpy()

template<typename T , class Context >
void dragon::math::Axpy ( const int  n,
const float  alpha,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Axpy< float16, CPUContext >()

template<>
void dragon::math::Axpy< float16, CPUContext > ( const int  n,
float  alpha,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

y += ax

◆ BroadcastAdd()

template<typename T , class Context >
void dragon::math::BroadcastAdd ( const int  rows,
const int  cols,
const int  type,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

     Broadcast Binary Functions

◆ BroadcastDiv()

template<typename T , class Context >
void dragon::math::BroadcastDiv ( const int  rows,
const int  cols,
const int  type,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ BroadcastMul()

template<typename T , class Context >
void dragon::math::BroadcastMul ( const int  rows,
const int  cols,
const int  type,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ BroadcastSet()

template<typename T , class Context >
void dragon::math::BroadcastSet ( const int  rows,
const int  cols,
const int  type,
const T *  x,
T *  y,
Context *  ctx 
)

◆ BroadcastSub()

template<typename T , class Context >
void dragon::math::BroadcastSub ( const int  rows,
const int  cols,
const int  type,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ Copy()

template<typename T , class Context >
void dragon::math::Copy ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

       Simple Unary Functions

◆ DEFINE_ADD_SCALAR_FUNC() [1/6]

dragon::math::DEFINE_ADD_SCALAR_FUNC ( int8_t  )

◆ DEFINE_ADD_SCALAR_FUNC() [2/6]

dragon::math::DEFINE_ADD_SCALAR_FUNC ( uint8_t  )

◆ DEFINE_ADD_SCALAR_FUNC() [3/6]

dragon::math::DEFINE_ADD_SCALAR_FUNC ( int  )

◆ DEFINE_ADD_SCALAR_FUNC() [4/6]

dragon::math::DEFINE_ADD_SCALAR_FUNC ( int64_t  )

◆ DEFINE_ADD_SCALAR_FUNC() [5/6]

dragon::math::DEFINE_ADD_SCALAR_FUNC ( float  )

◆ DEFINE_ADD_SCALAR_FUNC() [6/6]

dragon::math::DEFINE_ADD_SCALAR_FUNC ( double  )

◆ DEFINE_ASUM_FUNC() [1/2]

dragon::math::DEFINE_ASUM_FUNC ( float  )

◆ DEFINE_ASUM_FUNC() [2/2]

dragon::math::DEFINE_ASUM_FUNC ( double  )

◆ DEFINE_AXPBY_FUNC() [1/7]

dragon::math::DEFINE_AXPBY_FUNC ( int8_t  )

◆ DEFINE_AXPBY_FUNC() [2/7]

dragon::math::DEFINE_AXPBY_FUNC ( uint8_t  )

◆ DEFINE_AXPBY_FUNC() [3/7]

dragon::math::DEFINE_AXPBY_FUNC ( int  )

◆ DEFINE_AXPBY_FUNC() [4/7]

dragon::math::DEFINE_AXPBY_FUNC ( int64_t  )

◆ DEFINE_AXPBY_FUNC() [5/7]

dragon::math::DEFINE_AXPBY_FUNC ( float16  )

◆ DEFINE_AXPBY_FUNC() [6/7]

dragon::math::DEFINE_AXPBY_FUNC ( float  )

◆ DEFINE_AXPBY_FUNC() [7/7]

dragon::math::DEFINE_AXPBY_FUNC ( double  )

◆ DEFINE_AXPY_FUNC() [1/6]

dragon::math::DEFINE_AXPY_FUNC ( int8_t  )

◆ DEFINE_AXPY_FUNC() [2/6]

dragon::math::DEFINE_AXPY_FUNC ( uint8_t  )

◆ DEFINE_AXPY_FUNC() [3/6]

dragon::math::DEFINE_AXPY_FUNC ( int  )

◆ DEFINE_AXPY_FUNC() [4/6]

dragon::math::DEFINE_AXPY_FUNC ( int64_t  )

◆ DEFINE_AXPY_FUNC() [5/6]

dragon::math::DEFINE_AXPY_FUNC ( float  )

◆ DEFINE_AXPY_FUNC() [6/6]

dragon::math::DEFINE_AXPY_FUNC ( double  )

◆ DEFINE_BROADCAST_BINARY_FUNC() [1/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  )

◆ DEFINE_BROADCAST_BINARY_FUNC() [2/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  )

◆ DEFINE_BROADCAST_BINARY_FUNC() [3/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  )

◆ DEFINE_BROADCAST_BINARY_FUNC() [4/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  )

◆ DEFINE_BROADCAST_BINARY_FUNC() [5/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  ,
int8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [6/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  ,
uint8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [7/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  ,
int  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [8/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  ,
int64_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [9/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  ,
float  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [10/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Add  ,
double  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [11/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  ,
int8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [12/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  ,
uint8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [13/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  ,
int  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [14/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  ,
int64_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [15/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  ,
float  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [16/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Sub  ,
double  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [17/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  ,
int8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [18/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  ,
uint8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [19/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  ,
int  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [20/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  ,
int64_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [21/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  ,
float  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [22/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Mul  ,
double  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [23/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  ,
int8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [24/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  ,
uint8_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [25/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  ,
int  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [26/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  ,
int64_t  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [27/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  ,
float  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNC() [28/28]

dragon::math::DEFINE_BROADCAST_BINARY_FUNC ( Div  ,
double  ,
 
)

◆ DEFINE_BROADCAST_BINARY_FUNCTOR() [1/4]

dragon::math::DEFINE_BROADCAST_BINARY_FUNCTOR ( Add  )

◆ DEFINE_BROADCAST_BINARY_FUNCTOR() [2/4]

dragon::math::DEFINE_BROADCAST_BINARY_FUNCTOR ( Sub  )

◆ DEFINE_BROADCAST_BINARY_FUNCTOR() [3/4]

dragon::math::DEFINE_BROADCAST_BINARY_FUNCTOR ( Mul  )

◆ DEFINE_BROADCAST_BINARY_FUNCTOR() [4/4]

dragon::math::DEFINE_BROADCAST_BINARY_FUNCTOR ( Div  )

◆ DEFINE_BROADCAST_SET_FUNC() [1/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( bool  )

◆ DEFINE_BROADCAST_SET_FUNC() [2/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( int8_t  )

◆ DEFINE_BROADCAST_SET_FUNC() [3/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( uint8_t  )

◆ DEFINE_BROADCAST_SET_FUNC() [4/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( int  )

◆ DEFINE_BROADCAST_SET_FUNC() [5/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( int64_t  )

◆ DEFINE_BROADCAST_SET_FUNC() [6/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( float16  )

◆ DEFINE_BROADCAST_SET_FUNC() [7/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( float  )

◆ DEFINE_BROADCAST_SET_FUNC() [8/8]

dragon::math::DEFINE_BROADCAST_SET_FUNC ( double  )

◆ DEFINE_COPY_FUNC() [1/8]

dragon::math::DEFINE_COPY_FUNC ( bool  )

◆ DEFINE_COPY_FUNC() [2/8]

dragon::math::DEFINE_COPY_FUNC ( int8_t  )

◆ DEFINE_COPY_FUNC() [3/8]

dragon::math::DEFINE_COPY_FUNC ( uint8_t  )

◆ DEFINE_COPY_FUNC() [4/8]

dragon::math::DEFINE_COPY_FUNC ( int  )

◆ DEFINE_COPY_FUNC() [5/8]

dragon::math::DEFINE_COPY_FUNC ( int64_t  )

◆ DEFINE_COPY_FUNC() [6/8]

dragon::math::DEFINE_COPY_FUNC ( float16  )

◆ DEFINE_COPY_FUNC() [7/8]

dragon::math::DEFINE_COPY_FUNC ( float  )

◆ DEFINE_COPY_FUNC() [8/8]

dragon::math::DEFINE_COPY_FUNC ( double  )

◆ DEFINE_DOT_FUNC() [1/2]

dragon::math::DEFINE_DOT_FUNC ( float  )

◆ DEFINE_DOT_FUNC() [2/2]

dragon::math::DEFINE_DOT_FUNC ( double  )

◆ DEFINE_GEMM_FUNC() [1/2]

dragon::math::DEFINE_GEMM_FUNC ( float  )

◆ DEFINE_GEMM_FUNC() [2/2]

dragon::math::DEFINE_GEMM_FUNC ( double  )

◆ DEFINE_GEMV_FUNC() [1/2]

dragon::math::DEFINE_GEMV_FUNC ( float  )

◆ DEFINE_GEMV_FUNC() [2/2]

dragon::math::DEFINE_GEMV_FUNC ( double  )

◆ DEFINE_INVSTD_FUNC() [1/2]

dragon::math::DEFINE_INVSTD_FUNC ( float  )

◆ DEFINE_INVSTD_FUNC() [2/2]

dragon::math::DEFINE_INVSTD_FUNC ( double  )

◆ DEFINE_POWX_FUNC() [1/2]

dragon::math::DEFINE_POWX_FUNC ( float  )

◆ DEFINE_POWX_FUNC() [2/2]

dragon::math::DEFINE_POWX_FUNC ( double  )

◆ DEFINE_RANDOM_BERNOULI_FUNC() [1/3]

dragon::math::DEFINE_RANDOM_BERNOULI_FUNC ( uint8_t  )

◆ DEFINE_RANDOM_BERNOULI_FUNC() [2/3]

dragon::math::DEFINE_RANDOM_BERNOULI_FUNC ( uint32_t  )

◆ DEFINE_RANDOM_BERNOULI_FUNC() [3/3]

dragon::math::DEFINE_RANDOM_BERNOULI_FUNC ( float  )

◆ DEFINE_RANDOM_NORMAL_FUNC() [1/2]

dragon::math::DEFINE_RANDOM_NORMAL_FUNC ( float  )

◆ DEFINE_RANDOM_NORMAL_FUNC() [2/2]

dragon::math::DEFINE_RANDOM_NORMAL_FUNC ( double  )

◆ DEFINE_RANDOM_TRUNCATED_NORMAL_FUNC() [1/2]

dragon::math::DEFINE_RANDOM_TRUNCATED_NORMAL_FUNC ( float  )

◆ DEFINE_RANDOM_TRUNCATED_NORMAL_FUNC() [2/2]

dragon::math::DEFINE_RANDOM_TRUNCATED_NORMAL_FUNC ( double  )

◆ DEFINE_RANDOM_UNIFORM_FUNC() [1/3]

dragon::math::DEFINE_RANDOM_UNIFORM_FUNC ( uint32_t  ,
int   
)

◆ DEFINE_RANDOM_UNIFORM_FUNC() [2/3]

dragon::math::DEFINE_RANDOM_UNIFORM_FUNC ( float  ,
real   
)

◆ DEFINE_RANDOM_UNIFORM_FUNC() [3/3]

dragon::math::DEFINE_RANDOM_UNIFORM_FUNC ( double  ,
real   
)

◆ DEFINE_SCALE_FUNC() [1/6]

dragon::math::DEFINE_SCALE_FUNC ( int8_t  )

◆ DEFINE_SCALE_FUNC() [2/6]

dragon::math::DEFINE_SCALE_FUNC ( uint8_t  )

◆ DEFINE_SCALE_FUNC() [3/6]

dragon::math::DEFINE_SCALE_FUNC ( int  )

◆ DEFINE_SCALE_FUNC() [4/6]

dragon::math::DEFINE_SCALE_FUNC ( int64_t  )

◆ DEFINE_SCALE_FUNC() [5/6]

dragon::math::DEFINE_SCALE_FUNC ( float  )

◆ DEFINE_SCALE_FUNC() [6/6]

dragon::math::DEFINE_SCALE_FUNC ( double  )

◆ DEFINE_SET_FUNC() [1/7]

dragon::math::DEFINE_SET_FUNC ( bool  )

◆ DEFINE_SET_FUNC() [2/7]

dragon::math::DEFINE_SET_FUNC ( int8_t  )

◆ DEFINE_SET_FUNC() [3/7]

dragon::math::DEFINE_SET_FUNC ( uint8_t  )

◆ DEFINE_SET_FUNC() [4/7]

dragon::math::DEFINE_SET_FUNC ( int  )

◆ DEFINE_SET_FUNC() [5/7]

dragon::math::DEFINE_SET_FUNC ( int64_t  )

◆ DEFINE_SET_FUNC() [6/7]

dragon::math::DEFINE_SET_FUNC ( float  )

◆ DEFINE_SET_FUNC() [7/7]

dragon::math::DEFINE_SET_FUNC ( double  )

◆ DEFINE_SIMPLE_BINARY_FUNC() [1/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  )

◆ DEFINE_SIMPLE_BINARY_FUNC() [2/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  )

◆ DEFINE_SIMPLE_BINARY_FUNC() [3/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  )

◆ DEFINE_SIMPLE_BINARY_FUNC() [4/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  )

◆ DEFINE_SIMPLE_BINARY_FUNC() [5/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  ,
int8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [6/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  ,
uint8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [7/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  ,
int  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [8/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  ,
int64_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [9/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  ,
float  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [10/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Add  ,
double  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [11/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  ,
int8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [12/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  ,
uint8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [13/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  ,
int  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [14/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  ,
int64_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [15/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  ,
float  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [16/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Sub  ,
double  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [17/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  ,
int8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [18/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  ,
uint8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [19/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  ,
int  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [20/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  ,
int64_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [21/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  ,
float  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [22/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Mul  ,
double  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [23/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  ,
int8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [24/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  ,
uint8_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [25/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  ,
int  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [26/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  ,
int64_t  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [27/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  ,
float  ,
 
)

◆ DEFINE_SIMPLE_BINARY_FUNC() [28/28]

dragon::math::DEFINE_SIMPLE_BINARY_FUNC ( Div  ,
double  ,
 
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [1/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Exp  ,
float  ,
exp   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [2/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Exp  ,
double  ,
exp   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [3/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Log  ,
float  ,
log   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [4/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Log  ,
double  ,
log   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [5/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Inv  ,
float  ,
inverse   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [6/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Inv  ,
double  ,
inverse   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [7/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Sqrt  ,
float  ,
sqrt   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [8/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Sqrt  ,
double  ,
sqrt   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [9/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( RSqrt  ,
float  ,
rsqrt   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [10/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( RSqrt  ,
double  ,
rsqrt   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [11/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Square  ,
int8_t  ,
square   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [12/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Square  ,
uint8_t  ,
square   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [13/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Square  ,
int  ,
square   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [14/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Square  ,
int64_t  ,
square   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [15/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Square  ,
float  ,
square   
)

◆ DEFINE_SIMPLE_UNARY_FUNC() [16/16]

dragon::math::DEFINE_SIMPLE_UNARY_FUNC ( Square  ,
double  ,
square   
)

◆ DEFINE_SUM_FUNC() [1/6]

dragon::math::DEFINE_SUM_FUNC ( int8_t  )

◆ DEFINE_SUM_FUNC() [2/6]

dragon::math::DEFINE_SUM_FUNC ( uint8_t  )

◆ DEFINE_SUM_FUNC() [3/6]

dragon::math::DEFINE_SUM_FUNC ( int  )

◆ DEFINE_SUM_FUNC() [4/6]

dragon::math::DEFINE_SUM_FUNC ( int64_t  )

◆ DEFINE_SUM_FUNC() [5/6]

dragon::math::DEFINE_SUM_FUNC ( float  )

◆ DEFINE_SUM_FUNC() [6/6]

dragon::math::DEFINE_SUM_FUNC ( double  )

◆ Div()

template<typename T , class Context >
void dragon::math::Div ( const int  n,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ Dot()

template<typename T , class Context >
void dragon::math::Dot ( const int  n,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ Dot< float16, CPUContext >()

template<>
void dragon::math::Dot< float16, CPUContext > ( int  n,
const float16 *  a,
const float16 *  b,
float16 *  y,
CPUContext ctx 
)

◆ Exp()

template<typename T , class Context >
void dragon::math::Exp ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Exp< float16, CPUContext >()

template<>
void dragon::math::Exp< float16, CPUContext > ( int  n,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

       Simple Unary Functions

◆ Gemm()

template<typename T , class Context >
void dragon::math::Gemm ( const CBLAS_TRANSPOSE  TransA,
const CBLAS_TRANSPOSE  TransB,
const int  M,
const int  N,
const int  K,
const float  alpha,
const T *  A,
const T *  B,
const float  beta,
T *  C,
Context *  ctx,
TensorProto_DataType  math_type = TensorProto_DataType_FLOAT 
)

   Linear Algebra Binary Functions

◆ Gemm< float16, CPUContext >()

template<>
void dragon::math::Gemm< float16, CPUContext > ( const CBLAS_TRANSPOSE  TransA,
const CBLAS_TRANSPOSE  TransB,
const int  M,
const int  N,
const int  K,
const float  alpha,
const float16 *  A,
const float16 *  B,
const float  beta,
float16 *  C,
CPUContext ctx,
TensorProto_DataType  math_type 
)

   Linear Algebra Binary Functions

◆ Gemv()

template<typename T , class Context >
void dragon::math::Gemv ( const CBLAS_TRANSPOSE  TransA,
const int  M,
const int  N,
const float  alpha,
const T *  A,
const T *  x,
const float  beta,
T *  y,
Context *  ctx,
TensorProto_DataType  math_type = TensorProto_DataType_FLOAT 
)

◆ Gemv< float16, CPUContext >()

template<>
void dragon::math::Gemv< float16, CPUContext > ( const CBLAS_TRANSPOSE  TransA,
const int  M,
const int  N,
const float  alpha,
const float16 *  A,
const float16 *  x,
const float  beta,
float16 *  y,
CPUContext ctx,
TensorProto_DataType  math_type 
)

◆ Inv()

template<typename T , class Context >
void dragon::math::Inv ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Inv< float16, CPUContext >()

template<>
void dragon::math::Inv< float16, CPUContext > ( const int  n,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

◆ InvStd()

template<typename T , class Context >
void dragon::math::InvStd ( const int  n,
const float  eps,
const T *  x,
T *  y,
Context *  ctx 
)

        Extended Unary Functions

◆ InvStd< float16, CPUContext >()

template<>
void dragon::math::InvStd< float16, CPUContext > ( const int  n,
const float  eps,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

        Extended Unary Functions

◆ Log()

template<typename T , class Context >
void dragon::math::Log ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Log< float16, CPUContext >()

template<>
void dragon::math::Log< float16, CPUContext > ( int  n,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

◆ Mul()

template<typename T , class Context >
void dragon::math::Mul ( const int  n,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ Pow()

template<typename T , class Context >
void dragon::math::Pow ( const int  n,
const float  exp,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Pow< float16, CPUContext >()

template<>
void dragon::math::Pow< float16, CPUContext > ( int  n,
const float  alpha,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

y = x^e

◆ RandomBernoulli()

template<typename T , class Context >
void dragon::math::RandomBernoulli ( const int  n,
const float  p,
T *  y,
Context *  ctx 
)

◆ RandomNormal()

template<typename T , class Context >
void dragon::math::RandomNormal ( const int  n,
const float  mu,
const float  sigma,
T *  y,
Context *  ctx 
)

◆ RandomNormal< float16, CPUContext >()

template<>
void dragon::math::RandomNormal< float16, CPUContext > ( const int  n,
const float  mu,
const float  sigma,
float16 *  x,
CPUContext ctx 
)

◆ RandomTruncatedNormal()

template<typename T , class Context >
void dragon::math::RandomTruncatedNormal ( const int  n,
const float  mu,
const float  sigma,
const float  low,
const float  high,
T *  y,
Context *  ctx 
)

◆ RandomTruncatedNormal< float16, CPUContext >()

template<>
void dragon::math::RandomTruncatedNormal< float16, CPUContext > ( const int  n,
const float  mu,
const float  sigma,
const float  low,
const float  high,
float16 *  x,
CPUContext ctx 
)

◆ RandomUniform()

template<typename T , class Context >
void dragon::math::RandomUniform ( const int  n,
const float  low,
const float  high,
T *  y,
Context *  ctx 
)

          Random Functions

◆ RandomUniform< float16, CPUContext >()

template<>
void dragon::math::RandomUniform< float16, CPUContext > ( const int  n,
const float  low,
const float  high,
float16 *  x,
CPUContext ctx 
)

          Random Functions

◆ RSqrt()

template<typename T , class Context >
void dragon::math::RSqrt ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

◆ RSqrt< float16, CPUContext >()

template<>
void dragon::math::RSqrt< float16, CPUContext > ( int  n,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

◆ Scale()

template<typename T , class Context >
void dragon::math::Scale ( const int  n,
const float  alpha,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Scale< float16, CPUContext >()

template<>
void dragon::math::Scale< float16, CPUContext > ( const int  n,
const float  alpha,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

y = ax || x = ax

◆ Set()

template<typename T , class Context >
void dragon::math::Set ( const int  n,
const T  alpha,
T *  y,
Context *  ctx 
)

        Scale Unary Functions

◆ Set< float16, CPUContext >()

template<>
void dragon::math::Set< float16, CPUContext > ( const int  n,
const float16  alpha,
float16 *  y,
CPUContext ctx 
)

        Scale Unary Functions

y = a

◆ Sqrt()

template<typename T , class Context >
void dragon::math::Sqrt ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Sqrt< float16, CPUContext >()

template<>
void dragon::math::Sqrt< float16, CPUContext > ( int  n,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

◆ Square()

template<typename T , class Context >
void dragon::math::Square ( const int  n,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Square< float16, CPUContext >()

template<>
void dragon::math::Square< float16, CPUContext > ( int  n,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

◆ Sub()

template<typename T , class Context >
void dragon::math::Sub ( const int  n,
const T *  a,
const T *  b,
T *  y,
Context *  ctx 
)

◆ Sum() [1/2]

template<typename T , class Context >
void dragon::math::Sum ( const int  n,
const float  alpha,
const T *  x,
T *  y,
Context *  ctx 
)

◆ Sum() [2/2]

template<typename T , class Context >
T dragon::math::Sum ( const int  n,
const float  alpha,
const T *  x,
Context *  ctx 
)

◆ Sum< float16, CPUContext >()

template<>
void dragon::math::Sum< float16, CPUContext > ( const int  n,
const float  alpha,
const float16 *  x,
float16 *  y,
CPUContext ctx 
)

y = sum(x)