How to know current Expr's type, CallNode, IfNode or anything else

I want to know current Expr is CallNode , IfNode or anything else? how do I do?

  1. I see “Object::_type_key” can indicate the Expr’s type, but I don’t find any interface to get the _type_key? Should I use the interface "Object::GetTypeKey() " , but sometimes coredump happened when I call expr->GetTypeKey()
  2. is there any debug interface for printing the expr information when I use gdb to walkthrough the TVM source code ? thanks

You can use obj.as API in the c++, or isinstance in python

1 Like