Skip to content

Commit

Permalink
[Bugfix][Target] Correct passing of target-queried bool/int parameters (
Browse files Browse the repository at this point in the history
apache#8660)

Co-authored-by: Eric Lunderberg <[email protected]>
  • Loading branch information
2 people authored and ylc committed Sep 29, 2021
1 parent 613d291 commit ddb1218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/target/target.cc
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,9 @@ ObjectPtr<Object> TargetInternal::FromConfig(std::unordered_map<String, ObjectRe

case kTVMArgInt:
if (type_info.type_index == Integer::ContainerType::_GetOrAllocRuntimeTypeIndex()) {
attrs[key] = Bool(static_cast<bool>(ret));
} else if (type_info.type_index == Bool::ContainerType::_GetOrAllocRuntimeTypeIndex()) {
attrs[key] = Integer(static_cast<int64_t>(ret));
} else if (type_info.type_index == Bool::ContainerType::_GetOrAllocRuntimeTypeIndex()) {
attrs[key] = Bool(static_cast<bool>(ret));
} else {
LOG(FATAL) << "Expected " << type_info.type_key << " parameter for attribute '" << key
<< "', but received integer from device api";
Expand Down

0 comments on commit ddb1218

Please sign in to comment.