| 9 | |
| 10 | namespace tensorflow { |
| 11 | struct EmbeddingConfig { |
| 12 | int64 emb_index; |
| 13 | int64 primary_emb_index; |
| 14 | int64 block_num; |
| 15 | int64 slot_num; |
| 16 | std::string name; |
| 17 | int64 steps_to_live; |
| 18 | int64 filter_freq; |
| 19 | int64 max_freq; |
| 20 | float l2_weight_threshold; |
| 21 | int64 kHashFunc; |
| 22 | int64 num_counter; |
| 23 | DataType counter_type; |
| 24 | int64 default_value_dim; |
| 25 | float default_value_no_permission; |
| 26 | bool record_freq; |
| 27 | bool record_version; |
| 28 | bool is_inference; |
| 29 | |
| 30 | EmbeddingConfig(int64 emb_index = 0, |
| 31 | int64 primary_emb_index = 0, |
| 32 | int64 block_num = 1, |
| 33 | int slot_num = 0, |
| 34 | const std::string& name = "", |
| 35 | int64 steps_to_live = 0, |
| 36 | int64 filter_freq = 0, |
| 37 | int64 max_freq = 999999, |
| 38 | float l2_weight_threshold = -1.0, |
| 39 | int64 max_element_size = 0, |
| 40 | float false_positive_probability = -1.0, |
| 41 | DataType counter_type = DT_UINT64, |
| 42 | int64 default_value_dim = 4096, |
| 43 | float default_value_no_permission = .0, |
| 44 | bool record_freq =false, |
| 45 | bool record_version=false, |
| 46 | bool is_inference=false): |
| 47 | emb_index(emb_index), |
| 48 | primary_emb_index(primary_emb_index), |
| 49 | block_num(block_num), |
| 50 | slot_num(slot_num), |
| 51 | name(name), |
| 52 | steps_to_live(steps_to_live), |
| 53 | filter_freq(filter_freq), |
| 54 | max_freq(max_freq), |
| 55 | l2_weight_threshold(l2_weight_threshold), |
| 56 | counter_type(counter_type), |
| 57 | default_value_dim(default_value_dim), |
| 58 | default_value_no_permission(default_value_no_permission), |
| 59 | record_freq(record_freq), |
| 60 | record_version(record_version), |
| 61 | is_inference(is_inference) { |
| 62 | if (max_element_size != 0 && false_positive_probability != -1.0){ |
| 63 | kHashFunc = calc_num_hash_func(false_positive_probability); |
| 64 | num_counter = calc_num_counter(max_element_size, |
| 65 | false_positive_probability); |
| 66 | } else { |
| 67 | kHashFunc = 0; |
| 68 | num_counter = 0; |
no outgoing calls