MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / initialize

Method initialize

src/fastertransformer/models/decoder/Decoder.cc:22–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21template<typename T>
22void 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
52template<typename T>
53void Decoder<T>::allocateBuffer()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected