libdl  0.0.1
Simple yet powerful deep learning
Loading...
Searching...
No Matches
Arithmetic Tensor Operations
Collaboration diagram for Arithmetic Tensor Operations:

Functions

TensorPtr dl::pow (TensorPtr base, float exponent) noexcept
 Computes the exponent -th power of each element in base and returns the resulting tensor.
 
TensorPtr dl::exp (TensorPtr x) noexcept
 Computes the elementwise x -th power of e.
 
TensorPtr dl::log (TensorPtr x) noexcept
 Natural logarithm, \(\log_e(\,\cdot\,)\).
 
TensorPtr dl::sqrt (TensorPtr x) noexcept
 Computes the elementwise square root of x .
 
TensorPtr dl::rsqrt (TensorPtr x) noexcept
 Computes the reciprocal square root for each element in x.
 

Detailed Description

Function Documentation

◆ exp()

TensorPtr dl::exp ( TensorPtr  x)
noexcept

Computes the elementwise x -th power of e.

\[(x_i)_{1\leq i \leq n} \mapsto (e^{x_i})_{1\leq i \leq n}.\]

Parameters
base
Returns
the x -th power of e for each component of x .

◆ log()

TensorPtr dl::log ( TensorPtr  x)
noexcept

Natural logarithm, \(\log_e(\,\cdot\,)\).

\[(x_i)_{1\leq i \leq n} \mapsto (\log_e x_i)_{1\leq i \leq n}.\]

Parameters
x
Returns
the natural logarithm of x .

◆ pow()

TensorPtr dl::pow ( TensorPtr  base,
float  exponent 
)
noexcept

Computes the exponent -th power of each element in base and returns the resulting tensor.

Parameters
basethe basis for which to compute the exponent -th power.
exponentthe exponent.
Returns
the exponent -th power of each component of base .

◆ rsqrt()

TensorPtr dl::rsqrt ( TensorPtr  x)
noexcept

Computes the reciprocal square root for each element in x.

\[(x_i)_{1\leq i \leq n} \mapsto \left(\frac{1}{\sqrt{x_i}}\right)_{1\leq i \leq n}.\]

Parameters
x
Returns

◆ sqrt()

TensorPtr dl::sqrt ( TensorPtr  x)
noexcept

Computes the elementwise square root of x .

\[(x_i)_{1\leq i \leq n} \mapsto (\sqrt{x_i})_{1\leq i \leq n}.\]

Parameters
x
Returns
the square root of each component of x .