def _normalize_dim(dim: IntVar) -> IntVar:
    """
    Convert IntVars with the same upper and lower bounds to IntImms.
    """
    if isinstance(dim, IntImm) or dim.upper_bound() != dim.lower_bound():
        return dim
    return IntImm(dim.upper_bound())
Convert IntVars with the same upper and lower bounds to IntImms.
python/aitemplate/compiler/ops/tensor/expand.py