gpumatrix
gpumatrix copied to clipboard
.array().colwise() not supported
Hi, I was trying to do a column wise multiplication with gpumatrix. The corresponding code with Eigen is like the following:
Eigen::MatrixXd a = Eigen::MatrixXd::Random(5, 10);
Eigen::VectorXd v = Eigen::VectorXd::Random(5);
Eigen::MatrixXd b = a.array().colwise() * v.array();
When I compiled the following code:
gpumatrix::Matrix<double> da(a);
gpumatrix::Vector<double> dv(v);
gpumatrix::Matrix<double> db = da.array().colwise() * dv.array();
I got error messages like:
error: ‘class gpumatrix::Map<gpumatrix::Array<double, 2> >’ has no member named ‘colwise’
If colwise() is not meant to be implemented in gpumatrix, can you please enlighten me a workaround solution?
With eigen, there is a workaround using .asDiagonal() like:
b = a * v.asDiagonal();
However, da * dv.asDiagonal() does not work.
Also do you know why colwise is not supported for Eigen::TensorMap or in general dynamically sized Eigen tensor/matrix?