Class for performing matrix addition. More...
#include <functions.h>
Public Member Functions | |
| MatrixAddition (float *weights, int num_cols) | |
| Constructor for MatrixAddition. | |
| MatrixAddition (std::string weightsFile, int num_cols) | |
| Constructor for MatrixAddition. | |
| void | apply (const SelectivityVector &rows, std::vector< VectorPtr > &args, const TypePtr &type, exec::EvalCtx &context, VectorPtr &output) const override |
| Apply the matrix addition operation. | |
| float * | getTensor () const override |
| Get the tensor data associated with this function. | |
| std::string | getFuncName () |
| Get the name of the function. | |
| std::string | getWeightsFile () |
| Get the weights file associated with this function. | |
| void | setWeights (float *weights) |
| Set the weights for this function. | |
| CostEstimate | getCost (std::vector< int > inputDims) |
| Estimate the computational cost of the function. | |
Public Member Functions inherited from MLFunction | |
| virtual | ~MLFunction ()=default |
| Virtual destructor. | |
| virtual std::vector< int > | getDims () |
| Returns the dimensions of the function. | |
| virtual int | getNumDims () |
| Returns the number of dimensions of the function. | |
Static Public Member Functions | |
| static std::vector< std::shared_ptr< exec::FunctionSignature > > | signatures () |
| Get the function signatures for matrix addition. | |
| static std::string | getName () |
| Get the name of the function. | |
Additional Inherited Members | |
Protected Member Functions inherited from MLFunction | |
| double | getWeightedCost (std::string name, float cost) |
| Calculates the weighted cost of the function. | |
| std::vector< double > | getCoefficientVector (std::string name) |
| Retrieves the cost coefficients for the function. | |
Protected Attributes inherited from MLFunction | |
| std::vector< int > | dims |
| Dimensions of the function. | |
Class for performing matrix addition.
This class implements matrix addition, which adds two matrices element-wise. It supports both in-place addition and addition with a weight matrix.
|
inline |
Constructor for MatrixAddition.
| weights | A pointer to the weight matrix. |
| num_cols | The number of columns in the matrix. |
|
inline |
Constructor for MatrixAddition.
| weightsFile | The file containing the weight matrix. |
| num_cols | The number of columns in the matrix. |
|
inlineoverride |
Apply the matrix addition operation.
| rows | The selectivity vector indicating which rows to process. |
| args | The input arguments. |
| type | The type of the output vector. |
| context | The evaluation context. |
| output | The output vector. |
|
inlinevirtual |
Estimate the computational cost of the function.
| inputDims | The dimensions of the input data. |
Reimplemented from MLFunction.
|
inlinevirtual |
Get the name of the function.
Reimplemented from MLFunction.
|
inlinestatic |
Get the name of the function.
|
inlineoverridevirtual |
Get the tensor data associated with this function.
Implements MLFunction.
|
inline |
Get the weights file associated with this function.
|
inline |
Set the weights for this function.
| weights | A pointer to the weight matrix. |
|
inlinestatic |
Get the function signatures for matrix addition.