MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateEmbeddingVar

Function CreateEmbeddingVar

tensorflow/core/kernels/embedding_variable_test.h:106–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106EmbeddingVar<int64, float>* CreateEmbeddingVar(
107 int value_size, Tensor& default_value,
108 int64 default_value_dim, int64 filter_freq = 0,
109 int64 steps_to_live = 0,
110 float l2_weight_threshold=-1.0,
111 embedding::StorageType storage_type = embedding::StorageType::DRAM,
112 std::vector<int64> storage_size = {1024*1024*1024,
113 1024*1024*1024,
114 1024*1024*1024,
115 1024*1024*1024},
116 bool record_freq = false,
117 int64 max_element_size = 0,
118 float false_positive_probability = -1.0,
119 DataType counter_type = DT_UINT64) {
120 auto embedding_config = EmbeddingConfig(
121 0, 0, 1, 0, "emb_var", steps_to_live,
122 filter_freq, 999999, l2_weight_threshold,
123 max_element_size, false_positive_probability,
124 counter_type, default_value_dim,
125 0.0, record_freq, false, false);
126 auto feat_desc = new embedding::FeatureDescriptor<float>(
127 1, 1, ev_allocator(), storage_type,
128 record_freq,
129 embedding_config.is_save_version(),
130 {embedding_config.is_counter_filter(), filter_freq});
131 auto storage =
132 embedding::StorageFactory::Create<int64, float>(
133 embedding::StorageConfig(
134 storage_type, "",
135 storage_size,
136 embedding_config),
137 cpu_allocator(),
138 feat_desc,
139 "emb_var");
140 auto ev = new EmbeddingVar<int64, float>(
141 "emb_var",
142 storage,
143 embedding_config,
144 cpu_allocator(),
145 feat_desc);
146 ev->Init(default_value, default_value_dim);
147 return ev;
148}
149} //namespace embedding
150} //namespace tensorflow
151#endif // TENSORFLOW_CORE_FRAMEWORK_EMBEDDING_STORAGE_FACTORY_H_

Callers 6

TESTFunction · 0.85
InitEV_LocklessFunction · 0.85
PerfLookupOrCreateFunction · 0.85
TESTFunction · 0.85
PerfSaveFunction · 0.85
PerfMemoryFunction · 0.85

Calls 7

EmbeddingConfigClass · 0.85
ev_allocatorFunction · 0.85
StorageConfigClass · 0.85
cpu_allocatorFunction · 0.85
is_save_versionMethod · 0.80
is_counter_filterMethod · 0.80
InitMethod · 0.45

Tested by

no test coverage detected