|
|
|
@ -52,6 +52,7 @@ int LAPACKE_dgetri(int matrix_layout, int n, double* a, int lda,
|
|
|
|
|
|
|
|
|
|
#include <cmath>
|
|
|
|
|
|
|
|
|
|
#include "paddle/framework/eigen.h"
|
|
|
|
|
#include "paddle/framework/tensor.h"
|
|
|
|
|
#include "paddle/platform/device_context.h"
|
|
|
|
|
#include "paddle/platform/enforce.h"
|
|
|
|
@ -84,6 +85,13 @@ void matmul(const platform::DeviceContext& context,
|
|
|
|
|
const framework::Tensor& matrix_b, bool trans_b, T alpha,
|
|
|
|
|
framework::Tensor* matrix_out, T beta);
|
|
|
|
|
|
|
|
|
|
template <typename Place, typename T>
|
|
|
|
|
void SetConstant(const platform::DeviceContext& context,
|
|
|
|
|
framework::Tensor* tensor, T num) {
|
|
|
|
|
auto t = framework::EigenVector<T>::Flatten(*tensor);
|
|
|
|
|
t.device(*context.GetEigenDevice<Place>()) = t.constant(static_cast<T>(num));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace math
|
|
|
|
|
} // namespace operators
|
|
|
|
|
} // namespace paddle
|
|
|
|
|