From c6444e93d1a0d2ffaae8258fb6ecb6392f3d184c Mon Sep 17 00:00:00 2001 From: Vaibhav Pathak Date: Sun, 2 Apr 2023 19:41:56 +0530 Subject: [PATCH] Fixed Code Style issues --- .../methods/ann/layer/hard_tanh_impl.hpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/mlpack/methods/ann/layer/hard_tanh_impl.hpp b/src/mlpack/methods/ann/layer/hard_tanh_impl.hpp index 787ada121e..9b631ba6e1 100644 --- a/src/mlpack/methods/ann/layer/hard_tanh_impl.hpp +++ b/src/mlpack/methods/ann/layer/hard_tanh_impl.hpp @@ -22,27 +22,27 @@ template HardTanHType::HardTanHType( const double maxValue, const double minValue) : - Layer(), - maxValue(maxValue), - minValue(minValue) + Layer(), + maxValue(maxValue), + minValue(minValue) { // Nothing to do here. } template HardTanHType::HardTanHType(const HardTanHType& layer) : - Layer(layer), - maxValue(layer.maxValue), - minValue(layer.minValue) + Layer(layer), + maxValue(layer.maxValue), + minValue(layer.minValue) { // Nothing to do here. } template HardTanHType::HardTanHType(HardTanHType&& layer) : - Layer(std::move(layer)), - maxValue(std::move(layer.maxValue)), - minValue(std::move(layer.minValue)) + Layer(std::move(layer)), + maxValue(std::move(layer.maxValue)), + minValue(std::move(layer.minValue)) { // Nothing to do here. } @@ -50,7 +50,7 @@ HardTanHType::HardTanHType(HardTanHType&& layer) : template HardTanHType& HardTanHType::operator=(const HardTanHType& layer) { - if(&layer != this) + if (&layer != this) { Layer::operator=(layer); maxValue = layer.maxValue; @@ -63,7 +63,7 @@ HardTanHType& HardTanHType::operator=(const HardTanHType& laye template HardTanHType& HardTanHType::operator=(HardTanHType&& layer) { - if(&layer != this) + if (&layer != this) { Layer::operator=(std::move(layer)); maxValue = std::move(layer.maxValue); @@ -89,6 +89,7 @@ void HardTanHType::Backward( const MatType& input, const MatType& gy, MatType& g) { g = gy; + #pragma omp parallel for for (size_t i = 0; i < input.n_elem; ++i) {