MCPcopy Create free account
hub / github.com/Tencent/embedx / XOutputEmbeddingLookup

Function XOutputEmbeddingLookup

src/model/encoder/embedding_lookup_encoder.cc:62–70  ·  view source on GitHub ↗

/ output embedding lookup functions */ /

Source from the content-addressed store, hash-verified

60/* output embedding lookup functions */
61/************************************************************************/
62GraphNode* XOutputEmbeddingLookup(const std::string& prefix, GraphNode* X,
63 const GroupConfigItem3& item, int sparse) {
64 DXCHECK_THROW(X->shape().is_rank(2));
65 int tensor_type = sparse ? TENSOR_TYPE_SRM : TENSOR_TYPE_TSR;
66 auto* W =
67 GetVariable(prefix + "W", Shape(item.embedding_row, item.embedding_col),
68 tensor_type, TENSOR_INITIALIZER_TYPE_ZEROS, 0, 0);
69 return EmbeddingLookup("", X, W);
70}
71
72} // namespace embedx

Callers 1

InitGraphMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected