tkonolige opened a new pull request #7309:
URL: https://github.com/apache/tvm/pull/7309
I've added a new function `GetFullType` on all object that prints the type
of the object along with the types of objects it contains. I've only updated on
assert to use it so far, I'll update the rest in a subsequent PR. Here is an
example of how it improves error messages:
```
# before
Check failed: ObjectTypeChecker<TObjectRef>::Check(ptr) == false: Expect
Array[Operation] but get Array
# after
Check failed: ObjectTypeChecker<TObjectRef>::Check(ptr) == false: Expect
Array[Operation] but get Array[Tensor]
```
Note that because I've added a virtual function to Object, I'm now seeing
all these warnings:
```
../src/runtime/vm/memory_manager.cc: In function ‘void
tvm::runtime::vm::BufferDeleter(tvm::runtime::Object*)’:
../src/runtime/vm/memory_manager.cc:42:3: warning: deleting object of
polymorphic class type ‘tvm::runtime::NDArray::Container’ which has non-virtual
destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
42 | delete ptr;
```
I believe this warning is valid, but was not caused by this PR. We have
already been calling non-virtual destructors on polymorphic classes. Maybe we
should fix this in a separate PR?
@jroesch @tqchen @junrushao1994 @rkimball
----------------------------------------------------------------
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]