From 1ce9d34e7416598efee9ca02355ce1a2aae17316 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Mon, 25 Aug 2025 11:38:47 -0700 Subject: [PATCH 1/3] Allow none and string input types for Method --- runtime/executor/method.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/executor/method.cpp b/runtime/executor/method.cpp index e8f3c471b8f..528a68d608d 100644 --- a/runtime/executor/method.cpp +++ b/runtime/executor/method.cpp @@ -1055,7 +1055,7 @@ Method::set_input(const EValue& input_evalue, size_t input_idx) { const auto& e = get_value(get_input_index(input_idx)); - if (!e.isTensor() && !e.isScalar()) { + if (!(e.isNone() || e.isTensor() || e.isScalar() || e.isString())) { #if ET_LOG_ENABLED std::array tag_name; tag_to_string(e.tag, tag_name.data(), tag_name.size()); @@ -1088,7 +1088,9 @@ Method::set_input(const EValue& input_evalue, size_t input_idx) { return Error::InvalidArgument; } - if (e.isTensor()) { + if (e.isNone()) { + // no-op + } if (e.isTensor()) { const auto& t_dst = e.toTensor(); const auto& t_src = input_evalue.toTensor(); From a2730db436685cf4c39a2e86f5d57b4238937c5c Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Mon, 25 Aug 2025 13:13:06 -0700 Subject: [PATCH 2/3] Update method.cpp --- runtime/executor/method.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/executor/method.cpp b/runtime/executor/method.cpp index 528a68d608d..ede20834a30 100644 --- a/runtime/executor/method.cpp +++ b/runtime/executor/method.cpp @@ -1090,7 +1090,7 @@ Method::set_input(const EValue& input_evalue, size_t input_idx) { if (e.isNone()) { // no-op - } if (e.isTensor()) { + } else if (e.isTensor()) { const auto& t_dst = e.toTensor(); const auto& t_src = input_evalue.toTensor(); From aff65115c988cb246847375e51bc071fd0887b75 Mon Sep 17 00:00:00 2001 From: Anthony Shoumikhin Date: Mon, 25 Aug 2025 13:33:39 -0700 Subject: [PATCH 3/3] Update method.cpp --- runtime/executor/method.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/executor/method.cpp b/runtime/executor/method.cpp index ede20834a30..65a47594c8d 100644 --- a/runtime/executor/method.cpp +++ b/runtime/executor/method.cpp @@ -1088,9 +1088,9 @@ Method::set_input(const EValue& input_evalue, size_t input_idx) { return Error::InvalidArgument; } - if (e.isNone()) { + if (e.isNone()) { // no-op - } else if (e.isTensor()) { + } else if (e.isTensor()) { const auto& t_dst = e.toTensor(); const auto& t_src = input_evalue.toTensor();