[llvm] Changing creation of TensorSpec in a type agnostic manner. (PR #141161)

S. VenkataKeerthy via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 16:43:54 PDT 2025


https://github.com/svkeerthy created https://github.com/llvm/llvm-project/pull/141161

This change would enable using `ir2vec::Embedding` which are float vectors in ML Inliner. 

>From cdfa20603c35e9d555212487cc7d059a9fc61644 Mon Sep 17 00:00:00 2001
From: svkeerthy <venkatakeerthy at google.com>
Date: Thu, 22 May 2025 23:38:03 +0000
Subject: [PATCH] Changing creation of TensorSpec in a type agnostic manner.

---
 llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp b/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
index 2feedd2ff40af..e7e8f2ac1ff25 100644
--- a/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
+++ b/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
@@ -261,8 +261,8 @@ static const std::vector<TensorSpec> TrainingOnlyFeatures{
 static const std::vector<TensorSpec> getInputFeatures() {
   std::vector<TensorSpec> InputSpecs;
   for (size_t I = 0; I < NumberOfFeatures; ++I)
-    InputSpecs.push_back(TensorSpec::createSpec<int64_t>(
-        TFFeedPrefix + FeatureMap[I].name(), FeatureMap[I].shape()));
+    InputSpecs.push_back(
+        TensorSpec(TFFeedPrefix + FeatureMap[I].name(), FeatureMap[I]));
   append_range(InputSpecs, TrainingOnlyFeatures);
   return InputSpecs;
 }



More information about the llvm-commits mailing list