Skip to content

Commit ea18317

Browse files
authored
Allow none and string input types for Method (#13645)
1 parent 2100527 commit ea18317

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

runtime/executor/method.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ Method::set_input(const EValue& input_evalue, size_t input_idx) {
10551055

10561056
const auto& e = get_value(get_input_index(input_idx));
10571057

1058-
if (!e.isTensor() && !e.isScalar()) {
1058+
if (!(e.isNone() || e.isTensor() || e.isScalar() || e.isString())) {
10591059
#if ET_LOG_ENABLED
10601060
std::array<char, kTagNameBufferSize> tag_name;
10611061
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) {
10881088
return Error::InvalidArgument;
10891089
}
10901090

1091-
if (e.isTensor()) {
1091+
if (e.isNone()) {
1092+
// no-op
1093+
} else if (e.isTensor()) {
10921094
const auto& t_dst = e.toTensor();
10931095
const auto& t_src = input_evalue.toTensor();
10941096

0 commit comments

Comments
 (0)