tqchen commented on a change in pull request #7330:
URL: https://github.com/apache/tvm/pull/7330#discussion_r563307683
##########
File path: include/tvm/runtime/packed_func.h
##########
@@ -1360,14 +1376,16 @@ inline bool TVMPODValue_::IsObjectRef() const {
}
// NOTE: we don't pass NDArray and runtime::Module as RValue ref.
if (type_code_ == kTVMObjectRValueRefArg) {
- return
ObjectTypeChecker<TObjectRef>::Check(*static_cast<Object**>(value_.v_handle));
+ return !static_cast<bool>(
Review comment:
IsObjectRef can be used in code-path that expects multiple argument
variants.
```
if (arg.IsObjectRef<T0>()) {
} else {
another type of arg.
}
```
As a result, it is deseriiable to make the else path also fast(and not
constructing error messages). Given that the recursive checking logic is not
complicated. I think we could have separate impl for both
CheckAndGetMismatchMessage and Check.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]