Add SOFT_ASSERT to gracefully recover from invariant violations (#82689)
Summary: Implement SOFT_ASSERT that only fails in debug mode, but only trigger a warning log in release mode. This allows us to gracefully handle some of the invariant violation when processing traces that doesn't necessarily need to crash the entire program.
Test Plan: Added SOFT_ASSERT test in containers.cpp
Differential Revision: D38327334
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82689
Approved by: https://github.com/robieta