From fff3e8321f6d9cc73bb99470926473b98e6c461b Mon Sep 17 00:00:00 2001 From: Yash Singh Date: Thu, 10 Oct 2024 12:06:49 +0530 Subject: [PATCH] [Trivial] Clang format fixed and Rebased the PR Clang format fixed and comments removed. Rebased PR with latest changes. Signed-off-by: Yash Singh --- api/ccapi/include/layer.h | 2 +- api/nntrainer-api-common.h | 16 ++++++++-------- nntrainer/cl_context.cpp | 2 +- nntrainer/layers/cl_layers/addition_layer_cl.h | 2 +- .../layers/cl_layers/custom_vocab_selection.cpp | 15 --------------- .../layers/cl_layers/custom_vocab_selection.h | 2 +- nntrainer/layers/cl_layers/lm_head_layer_cl.h | 2 +- 7 files changed, 13 insertions(+), 28 deletions(-) diff --git a/api/ccapi/include/layer.h b/api/ccapi/include/layer.h index 3aa6150af6..9cd51dc4f9 100644 --- a/api/ccapi/include/layer.h +++ b/api/ccapi/include/layer.h @@ -109,7 +109,7 @@ enum LayerType { LAYER_RMSNORM = ML_TRAIN_LAYER_TYPE_RMSNORM, /**, TransposeLayerCl::type, ml::train::LayerType::LAYER_TRANSPOSE); - + cc.registerFactory(nntrainer::createLayer, CustomLMHeadLayerCl::type, ml::train::LayerType::LAYER_LM_HEAD); diff --git a/nntrainer/layers/cl_layers/addition_layer_cl.h b/nntrainer/layers/cl_layers/addition_layer_cl.h index e5ad7c91cf..a2b8f55f67 100644 --- a/nntrainer/layers/cl_layers/addition_layer_cl.h +++ b/nntrainer/layers/cl_layers/addition_layer_cl.h @@ -35,7 +35,7 @@ class AdditionLayerCL : public Layer { /** * @brief Destructor of Addition Layer */ - ~AdditionLayerCL() {}; + ~AdditionLayerCL(){}; /** * @brief Move constructor of AdditionLayer. diff --git a/nntrainer/layers/cl_layers/custom_vocab_selection.cpp b/nntrainer/layers/cl_layers/custom_vocab_selection.cpp index 4b25bebb74..171942be99 100644 --- a/nntrainer/layers/cl_layers/custom_vocab_selection.cpp +++ b/nntrainer/layers/cl_layers/custom_vocab_selection.cpp @@ -32,21 +32,6 @@ nntrainer::VocabSelectionNNTrainer::VocabSelectionNNTrainer( this->lshBits = lshBlockNum * lshBlockSize; this->lshData = std::vector(this->vocabCnt * lshBlockNum); - // for (unsigned int i = 0; i < vocabCnt; ++i) { - // for (unsigned int j = 0; j < lshBlockNum; ++j) { - // unsigned int actualSize = std::min(lshBlockSize, hiddenSize - - // (int)j * lshBlockSize); lshDataBlock d; for (unsigned int k = 0; k - // < actualSize; ++k) { - // d[k] = weights.getValue<_FP16>(0, 0, i, j * lshBlockSize + k) > - // 0 ? 1 : 0; - // } - // for (unsigned int k = actualSize; k < lshBlockSize; ++k) { - // d[k] = 0; - // } - // this->lshData[i * lshBlockNum + j] = d; - // } - // } - for (unsigned int i = 0; i < lshBlockNum; ++i) { unsigned int actualSize = std::min(lshBlockSize, hiddenSize - (int)i * lshBlockSize); diff --git a/nntrainer/layers/cl_layers/custom_vocab_selection.h b/nntrainer/layers/cl_layers/custom_vocab_selection.h index af3536d105..4334679397 100644 --- a/nntrainer/layers/cl_layers/custom_vocab_selection.h +++ b/nntrainer/layers/cl_layers/custom_vocab_selection.h @@ -93,7 +93,7 @@ class VocabSelectionNNTrainer : public VocabSelection { /** * @brief Destructor of VocabSelectionNNTrainer class */ - ~VocabSelectionNNTrainer() {}; + ~VocabSelectionNNTrainer(){}; }; } // namespace nntrainer diff --git a/nntrainer/layers/cl_layers/lm_head_layer_cl.h b/nntrainer/layers/cl_layers/lm_head_layer_cl.h index f22e4195de..74cfa3aad2 100644 --- a/nntrainer/layers/cl_layers/lm_head_layer_cl.h +++ b/nntrainer/layers/cl_layers/lm_head_layer_cl.h @@ -123,7 +123,7 @@ class CustomLMHeadLayerCl : public LayerImpl { * @copydoc Layer::exportTo(Exporter &exporter, ExportMethods method) */ void exportTo(nntrainer::Exporter &exporter, - const ml::train::ExportMethods &method) const override {}; + const ml::train::ExportMethods &method) const override{}; /** * @copydoc Layer::getType()