Home
last modified time | relevance | path

Searched refs:embedding_table (Results 1 – 19 of 19) sorted by relevance

/third_party/mindspore/mindspore/nn/layer/
Dembedding.py98 def __init__(self, vocab_size, embedding_size, use_one_hot=False, embedding_table='normal', argument
108 self.init_tensor = initializer(embedding_table, [vocab_size, embedding_size])
118 self.embedding_table = Parameter(self.init_tensor, name='embedding_table')
137 output_for_reshape = self.array_mul(one_hot_ids, self.embedding_table)
139 output_for_reshape = self.gather(self.embedding_table, flat_ids, 0)
146 …self.vocab_size, self.embedding_size, self.use_one_hot, self.embedding_table, self.dtype, self.pad…
248 … self.embedding_table = Parameter(initializer(param_init, [self.vocab_size, self.embedding_size]),
309 self.embedding_table.unique = self.forward_unique
331 self.embedding_table.cache_enable = self.cache_enable
332 self.embedding_table.cache_shape = (self.vocab_cache_size, self.embedding_size)
[all …]
Dthor_layer.py570 def __init__(self, vocab_size, embedding_size, use_one_hot=False, embedding_table='normal', argument
580 self.init_tensor = initializer(embedding_table, [vocab_size, embedding_size])
587 self.embedding_table = Parameter(self.init_tensor, name='embedding_table')
632 output_for_reshape = self.array_mul(one_hot_ids, self.embedding_table)
638 output_for_reshape = self.gather(self.embedding_table, flat_ids, 0)
641 output_for_reshape = self.gather(self.embedding_table, flat_ids, 0)
648 …self.vocab_size, self.embedding_size, self.use_one_hot, self.embedding_table, self.dtype, self.pad…
747 … self.embedding_table = Parameter(initializer(param_init, [self.vocab_size, self.embedding_size],
809 self.embedding_table.unique = self.forward_unique
861 self.embedding_table.cache_enable = self.cache_enable
[all …]
/third_party/mindspore/mindspore/ccsrc/ps/
Dparameter_server.cc395 AddressPtr embedding_table = std::make_shared<kernel::Address>(); in DoEmbeddingLookup() local
396 MS_EXCEPTION_IF_NULL(embedding_table); in DoEmbeddingLookup()
399 inputs.push_back(embedding_table); in DoEmbeddingLookup()
401 embedding_table->addr = table_ptr->data(); in DoEmbeddingLookup()
402 embedding_table->size = table_ptr->size() * sizeof(float); in DoEmbeddingLookup()
499 auto embedding_table = AnfAlgo::GetInputNode(cnode, 0); in GetEmbeddingTableParamPtr() local
500 if (IsPrimitiveCNode(embedding_table, prim::kPrimLoad)) { in GetEmbeddingTableParamPtr()
501 auto embedding_cnode = embedding_table->cast<CNodePtr>(); in GetEmbeddingTableParamPtr()
502 embedding_table = AnfAlgo::GetInputNode(embedding_cnode, 0); in GetEmbeddingTableParamPtr()
504 MS_EXCEPTION_IF_NULL(embedding_table); in GetEmbeddingTableParamPtr()
[all …]
/third_party/mindspore/mindspore/train/train_thor/
Dconvert_utils.py77 new_subcell.embedding_table = subcell.embedding_table
90 new_subcell.embedding_table = subcell.embedding_table
119 …if isinstance(subcell, (nn.Embedding, nn.EmbeddingLookup)) and subcell.embedding_table.requires_gr…
/third_party/mindspore/tests/ut/python/parallel/
Dtest_dynamic_shape.py60 self.embedding_table = Parameter(initializer('normal', [2000, 128]),
70 unique_id_weight = self.embedding_lookp(self.embedding_table, unique_id, 0)
94 self.embedding_table = Parameter(initializer('normal', [2000, 128]),
104 unique_id_weight = self.embedding_lookp(self.embedding_table, unique_id, 0)
Dtest_uniform_candidate_sampler.py34 self.embedding_table = Parameter(embedding_weight, "embedding_weight")
42 lookup = self.gatherv2(self.embedding_table, out1, 0)
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/ps/
Dembedding_look_up_ps_kernel.cc90 void EmbeddingLookUpPSKernel::UpdateEmbeddings(float *embedding_table, const size_t *lookup_ids, in UpdateEmbeddings() argument
99 auto ret = memcpy_s(embedding_table + IntToSize(index) * outer_dim_size_, dest_len, in UpdateEmbeddings()
Dembedding_look_up_ps_kernel.h39 void UpdateEmbeddings(float *embedding_table, const size_t *lookup_ids, const float *update_vals,
Dpserver_kernel.h41 …virtual void UpdateEmbeddings(float *embedding_table, const size_t *lookup_ids, const float *updat… in UpdateEmbeddings() argument
/third_party/mindspore/tests/st/model_zoo_tests/wide_and_deep/python_file_for_ci/
Dwide_and_deep.py157 self.embedding_table = var_map["V_l2"]
202 deep_id_embs = self.gather_v2(self.embedding_table, id_hldr, 0)
211 return out, self.embedding_table
233 predict, embedding_table = self.network(batch_ids, batch_wts)
236 l2_loss_v = self.reduceSum_false(self.square(embedding_table)) / 2
/third_party/mindspore/tests/st/networks/models/bert/src/
Dbert_model.py124 self.embedding_table = Parameter(initializer
144 one_hot_ids, self.embedding_table)
146 output_for_reshape = self.gather(self.embedding_table, flat_ids, 0)
148 return output, self.embedding_table
182 self.embedding_table = Parameter(initializer
214 self.embedding_table)
216 token_type_embeddings = self.gather(self.embedding_table, flat_ids, 0)
Dbert_for_pre_training.py167 sequence_output, pooled_output, embedding_table = \
170 embedding_table,
/third_party/mindspore/tests/st/networks/
Dtest_gpu_lstm.py70 …self.embedding = nn.Embedding(vocab_size, embed_size, use_one_hot=False, embedding_table=Tensor(we…
71 self.embedding.embedding_table.requires_grad = False
/third_party/mindspore/tests/mindspore_test_framework/apps/
Dtest_bert_parts.py64 sequence_output, pooled_output, embedding_table = \
66 return sequence_output, pooled_output, embedding_table
/third_party/mindspore/tests/st/fl/albert/src/
Dmodel.py139 self.embedding_table = Parameter(initializer
159 one_hot_ids, self.embedding_table)
161 output_for_reshape = self.gather(self.embedding_table, flat_ids, 0)
163 return output, self.embedding_table
180 self.embedding_table = Parameter(initializer
210 self.embedding_table)
212 token_type_embeddings = self.gather(self.embedding_table, flat_ids, 0)
/third_party/mindspore/tests/st/model_zoo_tests/DeepFM/src/
Ddeepfm.py211 self.embedding_table = var_map["V_l2"]
249 fm_id_embs = self.Gatherv2(self.embedding_table, id_hldr, 0)
265 return out, self.fm_w, self.embedding_table
/third_party/mindspore/tests/st/ps/cmp_sparse_embedding/
Dtest_cmp_sparse_embedding.py62 net.embedding.embedding_table.set_param_ps()
/third_party/mindspore/mindspore/parallel/nn/
Dtransformer.py525 … self.embedding_table = Parameter(initializer(param_init, [self.vocab_size, self.embedding_size]),
540 output = self.gather(self.embedding_table, input_ids, 0)
541 return output, self.embedding_table
/third_party/mindspore/mindspore/ccsrc/backend/session/
Dsession_basic.cc2656 auto embedding_table = AnfAlgo::GetInputNode(node->cast<CNodePtr>(), embedding_table_idx); in AssignParamKey() local
2657 size_t key = ps::Worker::GetInstance().SetParamKey(embedding_table->fullname_with_scope()); in AssignParamKey()