TinyChatEngine
Loading...
Searching...
No Matches
Fp32CLIPEncoder.h
1#include <cstdlib>
2#include <string>
3#include <vector>
4
5#include "Fp32CLIPEncoderLayer.h"
6#include "common.h"
7#include "operators.h"
8
10 Matrix3D<float> last_hidden_state;
11 std::vector<Matrix3D<float>> past_keys, past_values;
12};
14 Matrix3D<float> hidden_states;
15 Matrix3D<float> attention_mask;
16 std::vector<Matrix3D<float>> past_keys, past_values;
17 bool has_past_keys_values;
18
19 Fp32CLIPEncoder_input(Matrix3D<float> hidden_states_, Matrix3D<float> attention_mask_)
20 : hidden_states(hidden_states_), attention_mask(attention_mask_) {
21 has_past_keys_values = false;
22 }
23 Fp32CLIPEncoder_input(Matrix3D<float> hidden_states_, Matrix3D<float> attention_mask_,
24 std::vector<Matrix3D<float>> past_keys_, std::vector<Matrix3D<float>> past_values_)
25 : hidden_states(hidden_states_), attention_mask(attention_mask_), past_keys(past_keys_), past_values(past_values_) {
26 has_past_keys_values = true;
27 }
28};
29
31 public:
32 Fp32CLIPEncoder(std::string param_path, const struct model_config config);
34 struct Fp32CLIPEncoder_output forward(const struct Fp32CLIPEncoder_input& input);
35 std::vector<Fp32CLIPEncoderLayer> layers;
36 std::string profile_name = "Fp32CLIPEncoder";
37};
Definition Fp32CLIPEncoder.h:30
Definition common.h:34
Definition Fp32CLIPEncoder.h:13
Definition Fp32CLIPEncoder.h:9
Definition model.h:5