New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replaced SGVector::scale() with linalg::scale() #2928
Conversation
@@ -35,7 +38,7 @@ SGVector<float64_t> CMeanRule::combine(const SGMatrix<float64_t>& ensemble_resul | |||
SGVector<float64_t> mean_labels(row_sum, ensemble_result.num_rows); | |||
|
|||
float64_t scale = 1/(float64_t)ensemble_result.num_cols; | |||
mean_labels.scale(scale); | |||
linalg::scale<linalg::Backend::NATIVE>(mean_labels, scale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have already written using namespace linalg
, so you can omit the linalg::
here I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. linalg::
was necessary to avoid names conflist with float64_t scale
.
Hi @nginn. Thanks for the patch! It looks good. Please see my minor comments. We can merge it once you address those. |
Conflicts: src/shogun/machine/gp/EPInferenceMethod.cpp
…GVector) to .cpp file; added benchmark for SGVector::operator+=(SGVector)
updates here? |
template<class T> | ||
SGVector<T> SGVector<T>::operator+= (SGVector<T> x) | ||
{ | ||
linalg::add<linalg::Backend::NATIVE>(*this, x, *this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the a reason for NATIVE here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you remove the NATIVE, and just use the default backend (is set to eigen3 these days) |
@@ -25,6 +25,7 @@ | |||
#include <algorithm> | |||
|
|||
#include <shogun/mathematics/eigen3.h> | |||
#include <shogun/mathematics/linalg/linalg.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be guarded
It's the first part of the issue #2717