diff --git a/paddle/gserver/activations/ActivationFunction.cpp b/paddle/gserver/activations/ActivationFunction.cpp index bc3dd9ad5d86236697819d6ed389f197ce963fb0..220f220e0f2919ab69a164e6bf6265c3cbaa5494 100644 --- a/paddle/gserver/activations/ActivationFunction.cpp +++ b/paddle/gserver/activations/ActivationFunction.cpp @@ -345,7 +345,7 @@ void forward(Argument& act) { useGpu(act.deviceId)); act.in->copyFrom(*act.value); - act.value->log(*act.value); + act.value->log2(*act.value); } void backward(Argument& act) { act.grad->dotDiv(*act.grad, *act.in); } diff --git a/paddle/math/tests/test_BaseMatrix.cpp b/paddle/math/tests/test_BaseMatrix.cpp index 521ea8aeb09744a59e64d493062ce42748ee716b..f8c795a63918c5d52c8b92fad2d487c6e9f6df05 100644 --- a/paddle/math/tests/test_BaseMatrix.cpp +++ b/paddle/math/tests/test_BaseMatrix.cpp @@ -37,13 +37,13 @@ TEST(BaseMatrix, void) { }; compare(&BaseMatrix::neg); - compare(&BaseMatrix::exp); - compare(&BaseMatrix::log); - compare(&BaseMatrix::sqrt); - compare(&BaseMatrix::square); - compare(&BaseMatrix::reciprocal); - compare(&BaseMatrix::abs); - compare(&BaseMatrix::sign); + compare(&BaseMatrix::exp2); + compare(&BaseMatrix::log2); + compare(&BaseMatrix::sqrt2); + compare(&BaseMatrix::square2); + compare(&BaseMatrix::reciprocal2); + compare(&BaseMatrix::abs2); + compare(&BaseMatrix::sign2); compare(&BaseMatrix::zero); compare(&BaseMatrix::one); } @@ -59,7 +59,7 @@ TEST(BaseMatrix, real) { test.cmpWithoutArg<0>(f, height, width); }; - compare(&BaseMatrix::pow); + compare(&BaseMatrix::pow2); compare(&BaseMatrix::subScalar); compare(&BaseMatrix::mulScalar); compare(&BaseMatrix::divScalar); @@ -88,21 +88,21 @@ TEST(BaseMatrix, BaseMatrix) { compare(&BaseMatrix::softreluDerivative); compare(&BaseMatrix::brelu); compare(&BaseMatrix::breluDerivative); - compare(&BaseMatrix::square); + compare(&BaseMatrix::square2); compare(&BaseMatrix::squareDerivative); compare(&BaseMatrix::tanh); compare(&BaseMatrix::tanhDerivative); - compare(&BaseMatrix::reciprocal); + compare(&BaseMatrix::reciprocal2); compare(&BaseMatrix::reciprocalDerivative); - compare(&BaseMatrix::abs); + compare(&BaseMatrix::abs2); compare(&BaseMatrix::absDerivative); compare(&BaseMatrix::sigmoid); compare(&BaseMatrix::sigmoidDerivative); compare(&BaseMatrix::expDerivative); - compare(&BaseMatrix::sign); - compare(&BaseMatrix::exp); - compare(&BaseMatrix::log); - compare(&BaseMatrix::sqrt); + compare(&BaseMatrix::sign2); + compare(&BaseMatrix::exp2); + compare(&BaseMatrix::log2); + compare(&BaseMatrix::sqrt2); compare(&BaseMatrix::dotMul); compare(&BaseMatrix::dotMulSquare); compare(&BaseMatrix::dotSquareMul); @@ -143,7 +143,7 @@ TEST(BaseMatrix, BaseMatrix_real) { compare(&BaseMatrix::addBias); compare(&BaseMatrix::add); compare(&BaseMatrix::sub); - compare(&BaseMatrix::pow); + compare(&BaseMatrix::pow2); compare(&BaseMatrix::addScalar); compare(&BaseMatrix::subScalar); compare(&BaseMatrix::mulScalar); @@ -176,7 +176,7 @@ TEST(BaseMatrix, BaseMatrix_BaseMatrix) { compare(&BaseMatrix::logisticRegressionLoss); compare(&BaseMatrix::logisticRegressionLossBp); compare(&BaseMatrix::biggerThan); - compare(&BaseMatrix::max); + compare(&BaseMatrix::max2); compare(&BaseMatrix::dotMulSquare); compare(&BaseMatrix::dotSquareSquare); } diff --git a/paddle/math/tests/test_Tensor.cu b/paddle/math/tests/test_Tensor.cu index bd406da84515790f694168e8db7819cc5966654a..343e0631f60238780ce5bda21b108cfcb7e2a56e 100644 --- a/paddle/math/tests/test_Tensor.cu +++ b/paddle/math/tests/test_Tensor.cu @@ -18,6 +18,8 @@ limitations under the License. */ using namespace paddle; // NOLINT using namespace std; // NOLINT +using autotest::TensorCheckEqual; +using autotest::TensorCheckErr; #define INIT_UNARY(A1, A2) \ Tensor A1(height, width); \ diff --git a/paddle/math/tests/test_lazyAssign.cu b/paddle/math/tests/test_lazyAssign.cu index 275510e55bab934cdf3b430fe626c0a0c74f2110..b4ed8e4d632c48c525e3020e42fce78ddd986a64 100644 --- a/paddle/math/tests/test_lazyAssign.cu +++ b/paddle/math/tests/test_lazyAssign.cu @@ -19,6 +19,8 @@ limitations under the License. */ using namespace paddle; // NOLINT using namespace std; // NOLINT +using autotest::TensorCheckEqual; +using autotest::TensorCheckErr; typedef std::function testMatrixFunc; void testMatrixCase(testMatrixFunc matrixFunc) {