torch.fx.experimental.symbolic_shapes.cast_symbool_to_symint_guardless#
- torch.fx.experimental.symbolic_shapes.cast_symbool_to_symint_guardless(symbool)[source]#
Converts a SymBool or bool to a SymInt or int without introducing guards.
This function maps True to 1 and False to 0, preserving the symbolic nature of the input when it’s a SymBool. Unlike regular casting which might introduce guards, this function performs the conversion without adding any guards.