From 366198d93b7b9c73359f54f65d2fee0ec956b839 Mon Sep 17 00:00:00 2001 From: huxin711 Date: Fri, 13 May 2022 22:18:35 +0800 Subject: [PATCH] [NFC] polish colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h code style --- .../cuda_native/csrc/kernels/include/cross_entropy_layer.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h b/colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h index af7c9c04dc76..f4e9befc6588 100644 --- a/colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h +++ b/colossalai/kernel/cuda_native/csrc/kernels/include/cross_entropy_layer.h @@ -8,8 +8,9 @@ #include "cuda_util.h" -template class CrossEntropyLayer { -public: +template +class CrossEntropyLayer { + public: CrossEntropyLayer(float epsilon, int padding_idx, int max_batch_tokens); virtual ~CrossEntropyLayer(); @@ -22,7 +23,7 @@ template class CrossEntropyLayer { void set_cur_batch_shape(int batch_size, int seq_len, int vocab_size); -private: + private: void allocate_mem_buffer() { // allocate local gpu memory _loss_buffer = cuda_malloc(_max_batch_tokens * 2);