I’m looking at AssertStmt here:
https://docs.tvm.ai/api/python/dev.html#tvm.stmt.AssertStmt
The documentation doesn’t say very specifically what this op does (maybe there exists a different more in-depth doc source?).
Will the program be terminated if the condition is false?
Assuming the program is terminated, is this a guaranteed side-effect that will happen at the indicated time in the program, or is that more relaxed?
What happens with the error message, is it just returned, or is it presented to the user; where does it go?
I suppose the condition is intended to be guaranteed true only within the body of the AssertStmt, however I don’t quite understand that. Suppose I do (pseudocode):
if (…) {
AssertStmt(x is even, “x wasn’t even”, Foo())
Bar()
}
Then x is guaranteed to be even within Foo(), but isn’t it also guaranteed to be true at Bar(), given that the AssertStmt dominates Bar()? And if so, why is there a nested part to an AssertStmt? Or is the concern that the condition can become false if it contains mutable state loaded from memory? (I was thinking this was all immutable, but maybe not)