| 20 | |
| 21 | template<typename T> |
| 22 | void Decoder<T>::initialize() |
| 23 | { |
| 24 | self_attention_layer_ = new DecoderSelfAttentionLayer<T>(max_batch_size_, |
| 25 | head_num_, |
| 26 | size_per_head_, |
| 27 | stream_, |
| 28 | cublas_wrapper_, |
| 29 | allocator_, |
| 30 | is_free_buffer_after_forward_); |
| 31 | |
| 32 | cross_attention_layer_ = new DecoderCrossAttentionLayer<T>(max_batch_size_, |
| 33 | head_num_, |
| 34 | size_per_head_, |
| 35 | stream_, |
| 36 | cublas_wrapper_, |
| 37 | allocator_, |
| 38 | is_free_buffer_after_forward_); |
| 39 | |
| 40 | ffn_layer_ = new ReluFfnLayer<T>(max_batch_size_, |
| 41 | 1, |
| 42 | head_num_, |
| 43 | size_per_head_, |
| 44 | 0, // expert_num |
| 45 | inter_size_, |
| 46 | stream_, |
| 47 | cublas_wrapper_, |
| 48 | allocator_, |
| 49 | is_free_buffer_after_forward_); |
| 50 | } |
| 51 | |
| 52 | template<typename T> |
| 53 | void Decoder<T>::allocateBuffer() |
nothing calls this directly
no outgoing calls
no test coverage detected