You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/01/24 18:59:39 UTC

[GitHub] [tvm] junrushao1994 commented on a change in pull request #7330: [FFI] Improve error messages when array/map types do not match in function calls

junrushao1994 commented on a change in pull request #7330:
URL: https://github.com/apache/tvm/pull/7330#discussion_r563334447



##########
File path: include/tvm/node/container.h
##########
@@ -1449,31 +1449,41 @@ namespace runtime {
 // Additional overloads for PackedFunc checking.
 template <typename T>
 struct ObjectTypeChecker<Array<T>> {
-  static bool Check(const Object* ptr) {
-    if (ptr == nullptr) return true;
-    if (!ptr->IsInstance<ArrayNode>()) return false;
+  static Optional<String> Mismatch(const Object* ptr) {
+    if (ptr == nullptr) return Optional<String>();

Review comment:
       ```suggestion
       if (ptr == nullptr) return NullOpt;
   ```




----------------------------------------------------------------
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:
users@infra.apache.org