def is_symbolic(sym_val: Any) -> bool:
    """
    Check whether sym_val is a sympy class.
    """
    return isinstance(sym_val, sympy.Basic)
Check whether sym_val is a sympy class.
python/aitemplate/compiler/symbolic.py