/ output embedding lookup functions */ /
| 60 | /* output embedding lookup functions */ |
| 61 | /************************************************************************/ |
| 62 | GraphNode* 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 |