[llvm] [llvm-ir2vec] adding function-embedding map API to ir2vec python bindings (PR #177166)

Nishant Sachdeva via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 23:31:26 PST 2026


================
@@ -62,6 +69,27 @@ class PyIR2VecTool {
                                 .c_str());
     }
   }
+
+  nb::dict getFuncEmbMap() {
+    auto ToolFuncEmbMap = Tool->getFunctionEmbeddingsMap(OutputEmbeddingMode);
+    nb::dict NBFuncEmbMap;
+
+    for (const auto &[FuncPtr, FuncEmb] : ToolFuncEmbMap) {
+      std::string FuncName = FuncPtr->getName().str();
+      auto Data = FuncEmb.getData();
+      size_t Shape[1] = {Data.size()};
----------------
nishant-sachdeva wrote:

My bad. Debug artifact. Will remove this 

https://github.com/llvm/llvm-project/pull/177166


More information about the llvm-commits mailing list