geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::TensorMathImp Class Reference

#include <TensorMath.hpp>

Inheritance diagram for geopm::TensorMathImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::TensorMathImp:
Collaboration graph
[legend]

Public Member Functions

 TensorMathImp ()=default
 
virtual ~TensorMathImp ()=default
 
TensorOneD add (const TensorOneD &tensor_a, const TensorOneD &tensor_b) const override
 Add two 1D tensors of the same length, element-wise. More...
 
TensorOneD subtract (const TensorOneD &tensor_a, const TensorOneD &tensor_b) const override
 Subtract two 1D tensors of the same length, element-wise. More...
 
double inner_product (const TensorOneD &tensor_a, const TensorOneD &tensor_b) const override
 Multiply two 1D tensors, element-wise, and sum the result. More...
 
TensorOneD sigmoid (const TensorOneD &tensor) const override
 Compute logistic sigmoid function of 1D Tensor. More...
 
TensorOneD multiply (const TensorTwoD &, const TensorOneD &) const override
 Multiply a 2D tensor by a 1D tensor. More...
 
- Public Member Functions inherited from geopm::TensorMath
virtual ~TensorMath ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::TensorMath
static std::shared_ptr< TensorMathmake_shared ()
 Returns a shared_ptr to a concrete object constructed using the underlying implementation. More...
 

Constructor & Destructor Documentation

◆ TensorMathImp()

geopm::TensorMathImp::TensorMathImp ( )
default

◆ ~TensorMathImp()

virtual geopm::TensorMathImp::~TensorMathImp ( )
virtualdefault

Member Function Documentation

◆ add()

TensorOneD geopm::TensorMathImp::add ( const TensorOneD tensor_a,
const TensorOneD tensor_b 
) const
overridevirtual

Add two 1D tensors of the same length, element-wise.

Exceptions
geopm::Exceptionif the lengths do not match.
Parameters
[in]otherThe summand
Returns
Returns a 1D tensor, the sum of two 1D tensors

Implements geopm::TensorMath.

◆ inner_product()

double geopm::TensorMathImp::inner_product ( const TensorOneD tensor_a,
const TensorOneD tensor_b 
) const
overridevirtual

Multiply two 1D tensors, element-wise, and sum the result.

Exceptions
geopm::Exceptionif the lengths do not match.
Parameters
[in]otherThe multiplicand
Returns
Returns a 1D tensor, the product of two 1D tensors

Implements geopm::TensorMath.

◆ multiply()

TensorOneD geopm::TensorMathImp::multiply ( const TensorTwoD ,
const TensorOneD  
) const
overridevirtual

Multiply a 2D tensor by a 1D tensor.

Parameters
[in]TensorTwoD&Reference to the 2D multiplicand
[in]TensorOneD&Reference to the 1D multiplicand
Exceptions
geopm::Exceptionif the sizes are incompatible, i.e. if 2D tensor number of columns is unequal to 1D tensor number of rows

Implements geopm::TensorMath.

◆ sigmoid()

TensorOneD geopm::TensorMathImp::sigmoid ( const TensorOneD tensor) const
overridevirtual

Compute logistic sigmoid function of 1D Tensor.

Implements geopm::TensorMath.

◆ subtract()

TensorOneD geopm::TensorMathImp::subtract ( const TensorOneD tensor_a,
const TensorOneD tensor_b 
) const
overridevirtual

Subtract two 1D tensors of the same length, element-wise.

Exceptions
geopm::Exceptionif the lengths do not match.
Parameters
[in]otherThe subtrahend
Returns
A 1D tensor, the difference of two 1D tensors.

Implements geopm::TensorMath.


The documentation for this class was generated from the following files: