How to add assertion checks in Tensor compute definition?

While adding an operator in Topi, most of the time we need to put certain checks on dynamic input data values for which values are known at runtime only. Is there a way in the form of tensor expression, to assert values in compute definition?

For ex. An operator accepts indices as dynamic inputs and we want to check if they are out of bound. How to add such a kind of checks in the compute definition which will throw an error at the runtime.

if you are using hybrid script, I am sure that there is an assert statement that you may be interested. CC: @were

@junrushao1994, Thanks. I am not using hybrid script but this will help while using hybrid scripts. I will look into it. Also, does this mean TVM does not support assert natively and you have to use hybrid script for that?